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

cell changed in datagrid

Hi all. I've to retrive if a value in a cell is changed. How can I do it? Thanks a lot Paola

4 Replies

MI mike June 2, 2003 05:53 PM

> Hi all. > > I've to retrive if a value in a cell is changed. > > How can I do it? > > Thanks a lot > > Paola > >


MI mike June 2, 2003 05:59 PM

Sorry for the earlier blank reply. Basically, you just check the datasource for changes. You need to move the currentcell or the cell you were editing last won't get caught. 'Move the current cell to to the top left Datagrid1.CurrentCell = New DataGridCell(0, 0) 'check to see if the dataset has changed If DataSet1.HasChanges Then MessageBox.Show("There are changes in the datagrid") End If > Hi all. > > I've to retrive if a value in a cell is changed. > > How can I do it? > > Thanks a lot > > Paola > >


PA paola June 6, 2003 06:27 AM

Thanks Mike, it works fine. Move the cell modified to current I'm be able to change its backcolor, but I've another problem... Can I prevent the click event on a cell? Unfortunately when a user click on a cell it becames the current cell and so its backcolor changes.... I would change the backcolor only of the cell in which tha data change. Can you help me? Thanks a lot. Paola > Sorry for the earlier blank reply. > > Basically, you just check the datasource for changes. You need to move the currentcell or the cell you were editing last won't get caught. > > > 'Move the current cell to to the top left > Datagrid1.CurrentCell = New DataGridCell(0, 0) > 'check to see if the dataset has changed > If DataSet1.HasChanges Then > MessageBox.Show("There are changes in the datagrid") > End If > > > Hi all. > > > > I've to retrive if a value in a cell is changed. > > > > How can I do it? > > > > Thanks a lot > > > > Paola > > > > >


MI mike June 9, 2003 08:58 AM

Glad it works. You should be able to prevent the click event by overriding it without calling the base class click event handler. Or you could trap the event and move the focus to another control. > Thanks Mike, > it works fine. > Move the cell modified to current I'm be able to change its backcolor, > but I've another problem... > > Can I prevent the click event on a cell? > > Unfortunately when a user click on a cell it becames the current cell and so its backcolor changes.... I would change the backcolor only of the cell in which tha data change. > > Can you help me? > > Thanks a lot. > > Paola > > > Sorry for the earlier blank reply. > > > > Basically, you just check the datasource for changes. You need to move the currentcell or the cell you were editing last won't get caught. > > > > > > 'Move the current cell to to the top left > > Datagrid1.CurrentCell = New DataGridCell(0, 0) > > 'check to see if the dataset has changed > > If DataSet1.HasChanges Then > > MessageBox.Show("There are changes in the datagrid") > > End If > > > > > Hi all. > > > > > > I've to retrive if a value in a cell is changed. > > > > > > How can I do it? > > > > > > Thanks a lot > > > > > > Paola > > > > > > > > >

Loader.
Live Chat Icon For mobile
Up arrow icon