I have a data grid that is populated via dataset which is filled via SQL server. Some of the columns are numeric and are formatted for display per my users specfications via DataGridTextBoxColumn.format. It all looks great and the user was initially quite happy. When the user enters a cell to edit it the formatting remains and the entire cell contents is highlighted as normal. This is fine if the user is going to replace the entire value .... but if the user hits F2 and changes only a single digit in a larger number containing the formatting, the new value is replaced with the old value since the new value isn't "numeric" in the sense that it contains non-numeric characters.
What I want to do is leave the formatting as is but when the user moves from cell to cell I want to grab the "editable" value of the cell and remove all the formatting. In other words the value 55555 will display as "55,555" but when the user navigates to the cell the highlighted value in the cell would be "55555".
Thanks,
Zaf!

How do I zap the cell formatting when a user enters a cell in datagrid?
Question One
Figured it out on my own. Turns out this is REALLY simple to do.
First ... create your column styles using DataGridTextBoxColumn.
Then, right before you add it to the TableStyle.GridColumnStyles add a handler for the "TextChanged" event of the DataGridTextBoxColumn.TextBox member. On that event just zap the formatting from the text of the textbox. Highlighting still works by itself and so does the validation.
Dim myDataCol As New DataGridTextBoxColumn
--------------
AddHandler myDataCol.TextBox.TextChanged, AddressOf purge_cell_format
table_style.GridColumnStyles.Add(myDataCol)
--------------
Private Sub purge_cell_format(ByVal sender As Object, ByVal e As EventArgs)
'Replace formatting characters here
CType(sender, TextBox).Text = CType(sender, TextBox).Text.Replace(",", "")
End Sub
MrRogers
Hope that you will get workaround there.
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx
FrancoJS