G
GaryDean
I have a situation where characters are somehow getting stripped from a
textbox in an ItemTemplate in a cell of a DataGrid.
In the itemDataBound event I am moving data from columns created at run time
into other columns, created at design time, I have set up with Textboxes.
This program has ran correctly for months until this recent condition.
I have come upon the situation where a nvarchar field in a SQLServer table
has a carriage return character in it - a hex 0D. After the following two
lines of code are executed in the ItemDataBound event.....
Dim mytb As TextBox = CType(e.Item.Cells(t + 1).Controls(1), TextBox)
mytb.Text = e.Item.Cells(t + dg.Columns.Count).Text
mytb.Text correctly has received the string complete with the "0D" character
intact. However, when the grid is diplayed and later posted back, the "0D"
character is gone from the string. My program then makes an incorrect
assumption that the user modified the value in the textbox.
How and why is this 0D character getting stripped from the textbox?
textbox in an ItemTemplate in a cell of a DataGrid.
In the itemDataBound event I am moving data from columns created at run time
into other columns, created at design time, I have set up with Textboxes.
This program has ran correctly for months until this recent condition.
I have come upon the situation where a nvarchar field in a SQLServer table
has a carriage return character in it - a hex 0D. After the following two
lines of code are executed in the ItemDataBound event.....
Dim mytb As TextBox = CType(e.Item.Cells(t + 1).Controls(1), TextBox)
mytb.Text = e.Item.Cells(t + dg.Columns.Count).Text
mytb.Text correctly has received the string complete with the "0D" character
intact. However, when the grid is diplayed and later posted back, the "0D"
character is gone from the string. My program then makes an incorrect
assumption that the user modified the value in the textbox.
How and why is this 0D character getting stripped from the textbox?