By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 2,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Select/Highlight a DataGrid Row after Sorting

P: 26
I'm working in VS 2003.

I have a datagrid and its AllowSort property is set to true.

The columns of my grid are Inv No, Inv Desc and Apply To.

I added a function that will Search for an Apply To..Say I input "2123" in the textbox, then it will highlight the row from the datagrid with Apply To that is 2123.

The problem happens when I click the column headers so that it will be sorted.

Let's say on the first highlighting, it highlights the value 2123 that is in the 2nd row..Then after I sorted the columns, it still highlights the second row eventhough Apply To is not 2123.

Thanks guys..
Jan 7 '09 #1
Share this Question
Share on Google+
3 Replies

Expert 5K+
P: 7,872
I have that same problem.
The only thing I can think of is that you would have to run the "last search" again automatically
Jan 7 '09 #2

P: 26
yup, but it takes a long time to execute it, and the system is hanging. actually the main problem is that the datagrid.Select() method has an integer overload and that is the row number. I don't know how to change the datasource of the grid (a faster one) once I click the column headers. 'Coz it still selects the previous row number/s even though the values are not the one that I'm looking for.
Jan 7 '09 #3

P: 26
ok..this problem has already been solved.
Jan 8 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.