Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
How to keep a DataGrid in sync with a DataSet when sorting
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="prichards14, post: 4263231"] Somehow I got a second thread with the same topic going. Anyway, I am posting my solution here as well. Here is the line of code that has been giving me all of the trouble: Me.LabelDSIndex.Text = myDS.Tables("TableInfo").Rows(BindingContext(myDS, "TableInfo").Position).Item("cconsumernodid") If I sort the datagrid by clicking a column heading, the key value returned is what was at that position before the grid was sorted. This is my new new code which is working: Dim cm As CurrencyManager = CType(Me.BindingContext(DataGridNOD.DataSource, DataGridNOD.DataMember), CurrencyManager) Dim dv As DataView = CType(cm.List, DataView) Dim dr As DataRow dr = dv.Item(cm.Position).Row Me.LabelDSIndex.Text = dr(0).ToString Thank you for your help! -Pat [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
How to keep a DataGrid in sync with a DataSet when sorting
Top