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. Image for the cookie policy date
close icon

Where does the changed values on UI get stored?

I have a grid control that I populate using PopulateValues and giving it an array datasource. I have a CurrentCellCloseDropDown event in which I try to compare the newly select value with the previously selected value of the cell. I can get the newly selected value of the cell by doing: GridCurrentCell cc = m_GridControl.CurrentCell; cc.Renderer.ControlValue; However, I can''t find where the previous value of the cell is stored. When I look at the grid control or the datasource using indexers, they always have the initial values and not any of the new values. Where are user changed values stored for the cells?

3 Replies

AD Administrator Syncfusion Team August 16, 2004 09:14 PM UTC

Using an indexer on the gridControl should return any changed value (after you have moved off the cell). string oldValue = this.m_gridControl[cc.RowIndex,cc.ColIndex].Text;

JT James Tran August 17, 2004 11:31 AM UTC

I must be doing something wrong but that doesn''t work for me. I have attached a sample project. To got row 23 in the grid and change the second dropdown. A break point has already been set in the event. I still get the old value and not the new value. Change it again and you will still see the original value and not either of the two new values. CS_4279.zip

AD Administrator Syncfusion Team August 17, 2004 11:50 AM UTC

You should get the old value at this point. (Your orignail post described not being able to get the old value???) The indexer gives you the old value while the cell is actively being edited. The newvalue is not moved to the grid until you leave the cell (or call cc.ConfirmChanges()). When the cell is actively being edited, you can get the new value using cc.Renderer.ControlText. GridCurrentCell cc = gridControl1.CurrentCell; object oldValue = gridControl1[cc.RowIndex, cc.ColIndex].CellValue; object newValue = cc.Renderer.ControlText; Console.WriteLine(oldValue + " " + newValue);

Live Chat Icon For mobile
Up arrow icon