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

Get the CurrentCellChanged event to fire via setting the Text property of a cell

I''m setting up some unit tests (NUnit). The unit test involves setting the values of cells programmatically. For example: Grid(1, 3).Text = "3.0" The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. How can I get this event to fire? Is there another way to do it?

7 Replies

AD Administrator Syncfusion Team February 4, 2005 01:12 PM UTC

Look for a SaveCellText event or SaveCellInfo event. The CurrentCellChanged event is only fired when text in the current cell is changed, e.g. if you call grid.CurrentCell.Renderer.BeginEdit(); grid.CurrentCell.Renderer.Control = "3.0"; Stefan >I''m setting up some unit tests (NUnit). > >The unit test involves setting the values of cells programmatically. For example: > >Grid(1, 3).Text = "3.0" > >The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. > >How can I get this event to fire? Is there another way to do it? >


NZ Nick Zdunic February 6, 2005 05:06 PM UTC

How do I programmatically get the current cell to be a specific reference. For instance I want to grid cell reference (1, 3) to be set to 3.0 and therefore get the event to fire. >Look for a SaveCellText event or SaveCellInfo event. > >The CurrentCellChanged event is only fired when text in the current cell is changed, e.g. if you call > >grid.CurrentCell.Renderer.BeginEdit(); >grid.CurrentCell.Renderer.Control = "3.0"; > >Stefan > >>I''m setting up some unit tests (NUnit). >> >>The unit test involves setting the values of cells programmatically. For example: >> >>Grid(1, 3).Text = "3.0" >> >>The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. >> >>How can I get this event to fire? Is there another way to do it? >>


NZ Nick Zdunic February 6, 2005 05:11 PM UTC

Furthermore, the BeginEdit function is not present in CurrentCell in the version of the grid I''m using (2.0.5.0) The Control property is also readonly. >I''m setting up some unit tests (NUnit). > >The unit test involves setting the values of cells programmatically. For example: > >Grid(1, 3).Text = "3.0" > >The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. > >How can I get this event to fire? Is there another way to do it? >


AD Administrator Syncfusion Team February 6, 2005 08:17 PM UTC

Hi Nick, my fault - the code lines were wrong ... WRT to moving the current cell you need to call MoveTo. This code should work: grid.CurrentCell.MoveTo(1, 3)l grid.CurrentCell.BeginEdit(); grid.CurrentCell.Renderer.ControlText = "3.0"; To commit changes to the underlying grid call grid.CurrentCell.ConfirmChanges(); Stefan >Furthermore, the BeginEdit function is not present in CurrentCell in the version of the grid I''m using (2.0.5.0) The Control property is also readonly. > >>I''m setting up some unit tests (NUnit). >> >>The unit test involves setting the values of cells programmatically. For example: >> >>Grid(1, 3).Text = "3.0" >> >>The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. >> >>How can I get this event to fire? Is there another way to do it? >>


NZ Nick Zdunic February 7, 2005 03:38 AM UTC

Yep - that works. Thanks. >Hi Nick, > >my fault - the code lines were wrong ... > >WRT to moving the current cell you need to call MoveTo. > >This code should work: > > >grid.CurrentCell.MoveTo(1, 3)l >grid.CurrentCell.BeginEdit(); >grid.CurrentCell.Renderer.ControlText = "3.0"; > > >To commit changes to the underlying grid call > >grid.CurrentCell.ConfirmChanges(); > >Stefan > >>Furthermore, the BeginEdit function is not present in CurrentCell in the version of the grid I''m using (2.0.5.0) The Control property is also readonly. >> >>>I''m setting up some unit tests (NUnit). >>> >>>The unit test involves setting the values of cells programmatically. For example: >>> >>>Grid(1, 3).Text = "3.0" >>> >>>The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. >>> >>>How can I get this event to fire? Is there another way to do it? >>>


NZ Nick Zdunic February 7, 2005 03:54 AM UTC

Hi - just another thing. How do I get this to work for a checkbox column? >Yep - that works. Thanks. > >>Hi Nick, >> >>my fault - the code lines were wrong ... >> >>WRT to moving the current cell you need to call MoveTo. >> >>This code should work: >> >> >>grid.CurrentCell.MoveTo(1, 3)l >>grid.CurrentCell.BeginEdit(); >>grid.CurrentCell.Renderer.ControlText = "3.0"; >> >> >>To commit changes to the underlying grid call >> >>grid.CurrentCell.ConfirmChanges(); >> >>Stefan >> >>>Furthermore, the BeginEdit function is not present in CurrentCell in the version of the grid I''m using (2.0.5.0) The Control property is also readonly. >>> >>>>I''m setting up some unit tests (NUnit). >>>> >>>>The unit test involves setting the values of cells programmatically. For example: >>>> >>>>Grid(1, 3).Text = "3.0" >>>> >>>>The result should be the another grid gets updated. I''m doing this is the CurrentCellChanged event. This event is not being enacted. >>>> >>>>How can I get this event to fire? Is there another way to do it? >>>>


AD Administrator Syncfusion Team February 7, 2005 01:04 PM UTC

A checkbox has no active state, so there is no way to get CurrentCellChanged to be raised if you are programmatically changing the cellvale (do a CurrentCell.MovetTo and CurrentCell.BeginEdit does not work as there is no active state in a checkbox). Now your user ckecking the checkbox does raise the CurrentCellChanged event, but you programmatically changing it, does not. If you want to catch programmatic changes in a checkbox, you can use the SaveCellInfo event.

Loader.
Live Chat Icon For mobile
Up arrow icon