Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
How to navigate to a record in Datagridview
Madito Kevin
Apr 6 2015 5:58 AM
804
Reply
I want to navigate to a record in Datagridview by selecting/click on a record without using a button click.
and display a record number,or current record number.
Please help here is my code snippet.
private void labelUpdate()
{
if (hwdg.SelectedRows.Count>=inc)
{
hwdg.FirstDisplayedScrollingRowIndex = inc;
hwdg.Rows[inc].Selected = true;
//inc++;
label27.Text = "Record" + (inc + 1) + " of " + ds2.Tables["tblComp"].Rows.Count;
}
else if(hwdg.SelectedRows.Count<=inc)
{
hwdg.Rows[inc - 1].Selected = true;
label27.Text = "Record" + (inc + 1) + " of " + ds2.Tables["tblComp"].Rows.Count;
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
while importing access file it give format except in c#
how can we bind single row in data base to grid view as a co