Hi
In my application i have a simple grid where i need to make some operations is in DisplayMode and some other actions if the grid is in EditMode so i simply use the condition below, but for a reason that i dont unserstand the code inside the condition is executed even if i try to insert a new item. When i check the type of e.item it is a GridDataInsertItem and not a GridDataItem but the code inside the condition is still executed... I'm sure i'm missing something obvious but i cant figured out what it can be...
| Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound | |
| If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then | |
| 'the grid is EditMode | |
| Dim Item As GridEditableItem = e.Item | |
| End If | |
| If TypeOf (e.Item) Is GridDataItem Then | |
| 'the grid is not in editMode (DisplayMode) | |
| Dim dataBoundItem As GridDataItem = e.Item | |
| 'throw the conversion error because i dont have any ID yet | |
| Dim ID As Integer = dataBoundItem("DbId").Text | |
| End If | |
| End Sub |
Thanks in advance for your help.