Hi
I have just recently upgraded a project to AJAX Q3 2008 from the Classic 2008 version.
In the past, the code accesses read-only databound columns of a radgrid via the .text propery of the GridEditableItem (at ItemDatabound event), which would return a valid value. However! Since the upgrade, everything has fallen to pieces!
The GridEditableItem doesn't seem to hold read-only values now in the new version.
i.e.
This is the read-only column:
The first part of the VB code populates the radgrid rgdContact, then sets every row to Edit mode and rebinds
The second part of the VB code occurs on data bind events. If it is the rebind (every row is in edit mode) then it tries to access the read-only column. Here is the problem where a "nbsp;" value is returned for every read-only column.
I have just recently upgraded a project to AJAX Q3 2008 from the Classic 2008 version.
In the past, the code accesses read-only databound columns of a radgrid via the .text propery of the GridEditableItem (at ItemDatabound event), which would return a valid value. However! Since the upgrade, everything has fallen to pieces!
The GridEditableItem doesn't seem to hold read-only values now in the new version.
i.e.
This is the read-only column:
| <radTS:GridBoundColumn DataField="LastName" HeaderText="LastName" ReadOnly="True" UniqueName="LastName"> |
| </radTS:GridBoundColumn> |
The first part of the VB code populates the radgrid rgdContact, then sets every row to Edit mode and rebinds
| rgdContact.DataSource = dt |
| rgdContact.DataBind() |
| For Each GDItem As GridDataItem In rgdContact.Items |
| GDItem.Edit = True |
| Next |
| rgdContact.Rebind() |
The second part of the VB code occurs on data bind events. If it is the rebind (every row is in edit mode) then it tries to access the read-only column. Here is the problem where a "nbsp;" value is returned for every read-only column.
| Private Sub rgdContact_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgdContact.ItemDataBound |
| If TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode Then |
| Dim gridEditFormItem As GridEditableItem = CType(e.Item, GridEditableItem) |
| Dim strLastName As String = gridEditFormItem.Item("LastName").text |
| 'strLastName "nbsp;" for some reason! |
| End If |
| End Sub |