I've a multi-select WebDropDown as a template column in the UltraWebGrid. The data loads properly for the first time but on the post back (save button click), the webdropdown looses selected items and looses the data as well.
Any help would be appreciated?
Thanks for the response.
I'm binding the control in grid's Initialize Row event and never rebinding it in the postback. My WebDropDown is in a template Column of a UltraWebGrid ... see code below... Also, this control works fine if used within a WebDataGrid.
.aspx
<
igtbl:TemplatedColumn Key="SpecimenSuffixTypeKeyColumnName" IsBound="false" Hidden="false" Width="23%">
code-behind
Private
cboSpecimenSuffixType.ValueField = "SpecimenSuffixTypeKey"
cboSpecimenSuffixType.TextField = "ShortName"
cboSpecimenSuffixType.DataMember =
String.Empty
cboSpecimenSuffixType.DataSource = new DataView(SpecimenSuffixTypesDataSet.SpecimenSuffixTypes, "", "", DataViewRowState.CurrentRows)
cboSpecimenSuffixType.DataBind()
cboSpecimenSuffixType.SelectedItems.Clear()
' then we select the items in the drop-down based on what is selected for that record in the database.
Hi,
I suppose what happens is that the control gets rebound, and you access the selected items and stuff afterwards. How do you declare the WebDropDown in the templated column? Where does it get the data from? In the mean time you can take a look at the WebDataGrid's DropDown Editor Provider - one of its advantages is that it keeps only one instance of the control for the whole grid.
Thanks,
Angel