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

how to get selected row after sorting a DataViewGrid ???

P: n/a

I have a DataViewgrid that is filled with records sorted on a column 'Date'.When double-clicking on a row do I view the selected row in another window. So far so good

But when I sort the DataViewgrid on another column and dbl-click again do I get a different row than the one selected ???

How can I make sure that the selected row is always shown ?

************************************************** ********************
Sent via Fuzzy Software @
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Feb 14 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hi .. do not use row indexing by numbers but use its DataBound object


DataGridView dgv = new DataGridView();
DataGridView subdgv = new DataGridView();
dgv.RowEnter += new DataGridViewCellEventHandler(dgv_RowEnter);

void dgv_RowEnter(object sender, DataGridViewCellEventArgs e)
subdgv.DataSource =

you're all set.

Feb 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.