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

controltext vs cellvalue

I''m having some problems trying to tell when data has changed and trying to update cells at the same time. Say u have a grid with 10 rows and 2 columns. I want the user to be able to enter values in 2 consecutive rows ONLY. so like if they enter a value in row 3 then i want to make rows 2,3 and 4 clickable and enabled but i want to make row 1 and then 5 through 10 not clickable or enabled. Im trying to do this through the currentcellchanging event. the problem i''m having is that in this event the cellvalue isnt updated until they leave the event. so for example if the user had 50 in row4 and 50 in row 5 and then they hit delete on the row4 the cellvalue is still 50 but the controltext is 0. the cellvalue doesnt get updated until u leave the event. is there any other event that can accomplish what i want that would have the cellvalue changed so i dont have to set up a renderer variable and a gridstyleinfo? i have to use the renderer to get to the controltext.

1 Reply

AD Administrator Syncfusion Team March 10, 2004 01:47 PM UTC

You can get the renderer from the current cell when you need it to get the ControlText. (ie, grid.CurrentCell.Renderer.COntrolText). Anyway, you can use CurrentCellAcceptedChanges if you want to get the change value from the cell style directly. This is an event that fires after the value has been set into the cell style. Private Sub GridControl1_CurrentCellAcceptedChanges(ByVal sender As Object, ByVal e As CancelEventArgs) Handles GridControl1.CurrentCellAcceptedChanges Dim cc As GridCurrentCell = Me.GridControl1.CurrentCell Console.WriteLine(Me.GridControl1(cc.RowIndex, cc.ColIndex).Text) End Sub

Live Chat Icon For mobile
Up arrow icon