Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5549
Edit which Cell and custom Dataset
posted

Hi, i bind my Wingrid to a custom generated Dataset. This Dataset consist of an id column, a date and serveral integer and string columns.
i get my data from a sql server database get the data and loop through each row from the table and build from this data a custom dataset, this i bind to the Wingrid.
Now when i edit a cell of a row how can i recognize the changed cell and how can i update the data in my table

the table has the following construct
id date description value
1,12.06.2009, test,4000
2,12.06.2009,test2,5000
3,12.06.2009,test3,6000
4,13.06.2009, test,4400
5,13.06.2009,test2,5500
6,13.06.2009,test3,6600
7,14.06.2009, test,4700
8,14.06.2009,test2,5800
9,14.06.2009,test3,6900

the custom dataset and the following grid i create from them looks like
id,date, test,test2,test3

1,12.06.2009 ,4000,5000,6000
2,13.06.2009 , 4400,5500,6600
3,14.06.2009 , 4700,5800,6900

now i wanna change the value of the marked row,marked value

is that possible ?
greetings

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    This doesn't seem to be a question about the WinGrid. You appear to be asking who you can associate a row in your custom DataSet with a row in the original DataSet or SQL Server database. The grid, of course, knows nothing about your original data, it only knows the data source it is bound to.

    So you would have to come up with a way to associate the data yourself.

    So I'm not sure I understand the question.

  • 37774
    posted

    If I'm reading this correctly, you want to map the row from your custom DataSet back to the original DataSet that you got from your database.  This isn't really anything specific to the grid, but you'd probably have to loop through all the rows to find the matching value in that column and then update the other values accordingly.  One thing you might consider is to keep an unbound column with the index of the original row so that you can look it up later, then set the column.Hidden property on the grid so that the user can't see it.

    -Matt

  • 27093
    posted

    Hello Martin,

    If you only want to visualize the edited rows you can set a backColor or Font or FontWeight in either the AfterRowUpdate or AfterCellUpdate events.

    If you need the dataTable row to be recognizable trough code you should have a boolean column for that which you can hide from the ultraGrid visualized columns.

    Hope this is what you ment. If not please describe your situation in more details.

    Sincerely,

    Petar Monov

    Developer Support Engineer,

    Infragistics, Inc