If i comment out the selectvalue portion it works and i am able to ADD NEW Item.
If i un-comment those lines i am only able to EDIT the items but when i click add new button it does nothing.
THanks
If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) Dim Manufacturers As RadComboBox = CType(editedItem.FindControl("ManufacturerEdit"), RadComboBox) ProductsAccess.BindManufacturers(Manufacturers) 'Dim Manufacturer As Integer = DataBinder.Eval(editedItem.DataItem, "Manufacturer").ToString 'Manufacturers.SelectedValue = Manufacturer Dim Categories As RadComboBox = CType(editedItem.FindControl("CategoryEdit"), RadComboBox) ProductsAccess.BindCategories(Categories) 'Dim Category As Integer = DataBinder.Eval(editedItem.DataItem, "Category").ToString 'Categories.SelectedValue = CategoryIf i un-comment those lines i am only able to EDIT the items but when i click add new button it does nothing.
If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) Dim Manufacturers As RadComboBox = CType(editedItem.FindControl("ManufacturerEdit"), RadComboBox) ProductsAccess.BindManufacturers(Manufacturers) Dim Manufacturer As Integer = DataBinder.Eval(editedItem.DataItem, "Manufacturer").ToString Manufacturers.SelectedValue = Manufacturer Dim Categories As RadComboBox = CType(editedItem.FindControl("CategoryEdit"), RadComboBox) ProductsAccess.BindCategories(Categories) Dim Category As Integer = DataBinder.Eval(editedItem.DataItem, "Category").ToString Categories.SelectedValue = CategoryProductsAccess.BindManufacturers(Manufacturers)
is a pretty simple Sub that bind combobox to datatable. I even tried
with iterating DataRows in the DataTable.Rows collection and populating
the combo one by one. The problem persisted :( THanks