We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

changing value of sorted field overwrites data in other rows!

Thread ID:

Created:

Updated:

Platform:

Replies:

5115 Jun 19,2003 06:30 PM UTC Jun 24,2003 02:15 PM UTC WinForms 1
loading
Tags: FAQ
Lori
Asked On June 19, 2003 06:30 PM UTC

I have a table that is represented in a datagrid. The datagrid is read-only, but the detail of the table is reflected in controls underneath, which are editable (see attached screen shot). The problem occurs when the user is sorting by a particular column (RequestUser, for example) and then they change the value of the field, causing the position of the row to change due to the sort. This changes fields in rows whose position changed due to the reorder. I've tried removing the sort first, finding the row, changing the value and then reapplying the sort and then finding the row again, which works most of the time -- but when it doesn't work it still overwrites data, in addition to being extremely unwieldy code. Please, any suggestions?

Sameer
Replied On June 24, 2003 02:15 PM UTC

Lori, Could u post the code ur using to update ur data set. I dont think the problem is with sorting or any such, the thing u should try doing is update the datarow, by indexing the dataview. DataRow dr = [urtable].DefaultView[currRowOnBlotter].Row ; and then update this row in the dataset. Hope this helps. -S > I have a table that is represented in a datagrid. The datagrid is read-only, but the detail of the table is reflected in controls underneath, which are editable (see attached screen shot). > > The problem occurs when the user is sorting by a particular column (RequestUser, for example) and then they change the value of the field, causing the position of the row to change due to the sort. This changes fields in rows whose position changed due to the reorder. > > I've tried removing the sort first, finding the row, changing the value and then reapplying the sort and then finding the row again, which works most of the time -- but when it doesn't work it still overwrites data, in addition to being extremely unwieldy code. > > Please, any suggestions?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;