Posted 16 January 2025, 7:44 am EST
I am using the C1.WPF.Grid.FlexGrid in NET8, VB.net, and I have encountered an issue related to text updates in cells.
I am using Class Inherits from GridCellFactory, and using Overrides Function CreateCellEditor for create textbox.
When I modify the text in a cell and press Enter, the updated text is successfully saved. However, if I change the text in a cell and then use the mouse to navigate to another row without pressing Enter, the updated text disappears, and the cell reverts to its previous value.
Could you please advise on how to ensure that the updated text is retained when navigating with the mouse after modifying a cell?
Thank you for your assistance.
This is my code in CreateCellEditor :
'---------- code ---------------
Dim tb As New TextBox()
tb.BorderThickness = New Thickness(1)
tb.VerticalScrollBarVisibility = ScrollBarVisibility.Auto
tb.TextWrapping = TextWrapping.Wrap
tb.AutoWordSelection = False
tb.AcceptsReturn = False
tb.AcceptsTab = False
tb.Background = Brushes.Transparent
Dim binding As New Binding(Grid.Columns(range.Column).ColumnName)
binding.Mode = BindingMode.Default
binding.Source = Grid.Rows(range.Row).DataItem
binding.Mode = BindingMode.TwoWay
tb.SetBinding(TextBox.TextProperty, binding)
Return tb
'----------------------------------------