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: 4263197"] I am working on a project developed by another programmer. Currently, there is no support for DataGrid sorting. If I set AllowSorting to True, I can sort by clicking the column headers. However, the sort order of the data in the underlying DataSet is not altered. As an example, I have a DataGrid with one column containg data rows B, C, A. If I click the column header, the data is sorted A, B, C. If I select the second row and click Edit, the Edit form displays the data for C, not B. I have been reading articles and postings for hours on some workarounds, but I have not found a solution. I want to bind the data to the grid in such a way that if I sort the grid by clicking a column header, the underlying data is sorted as well. One post I read said that using a DataSet with a DataGrid creates a default DataView that is not bound to the grid, as far as sorting is concerned. The poster said to explicitly create a DataView for the DataSet and bind it to the DataGrid. This is what I want to do, but I have no idea how. A simple code example would help me the most, or a link to web site that explains this. I am very new to .Net and I am really struggling with this. Thanks! -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