TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
faraz akram
NA
129
0
datagridview rows selection
Mar 29 2010 9:11 AM
hellow
i have a datagridview control that is filling a dataset of 5000 rows. now i want to select row(s) on any input value. but for this i have to loop through the whole datagrid view rows to find out all matches and selecting them here is the code
for
(
int
i = 0; i < dataGridView1.RowCount; i++)
{
if
((variable.Equals(dataGridView1.Rows[i].Cells[3].Value.ToString())))
{
dataGridView1.FirstDisplayedScrollingRowIndex = i;
dataGridView1.Refresh();
dataGridView1.Rows[i].Selected =
true
;
}
else
{
dataGridView1.Rows[i].Selected =
false
;
}
}
the abouve code is working fine but its v slow as it has to went through 5000 rows, any effcient way to do the bove.
thanks
fazy
Reply
Answers (
1
)
How do I: Use ReportViewer reports from a folder.
How can I find WIN32 constants values?