I have a drop down list in a radgrid and on edit mode or insert mode it needs to load it. That's all taken care of however what it does in insert mode is loads the dropdown list with both SQL statements, and I am rather perplexed of why this happens since they are 2 different modes of The grid.
So when in insert mode it shows the resulsts of both sql statements and not just the
Protected Sub myRadGrid_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles myRadGrid.ItemDataBound If (TypeOf e.Item Is IGridInsertItem AndAlso e.Item.IsDataBound) Then Dim Region As DropDownList = DirectCast(e.Item.FindControl("ddlRegion"), DropDownList) sql = "Select intRegionID, strRegionCode from Region where bitActive = 1" Region.Items.Add(New ListItem("Pick Region", "0")) buildDD(sql, Region) End If If (TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode) Then Dim Item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) Dim Region As DropDownList = DirectCast(Item.FindControl("ddlRegion"), DropDownList) sql = "Select intRegionID, strRegionCode from Region" Region.Items.Add(New ListItem("Pick Region", "0")) buildDD(sql, Region) Region.SelectedValue = DirectCast(DataBinder.Eval(e.Item.DataItem, "intRegionid").ToString(), String) End If End SubSo when in insert mode it shows the resulsts of both sql statements and not just the
IGridInsertItem mode.