When WebDropDown on UpdatePanel is filled with data it shows first item from its data source.
In code behind when I handle link button click it claims that SelectedValue = null, although from user point of view there is some selection visible on the screen.
What should I do to get selected value properly?
Nothing special here I guess :
<ig:WebDropDown ID="cmbUN" runat="server" DataSourceID="ADR_uny" TextField="un_str"Width="200px" DropDownContainerWidth="300px" EnableAutoFiltering="Client" ValueField="id_un"><DropDownItemBinding TextField="un_str" ValueField="id_un" /></ig:WebDropDown>
Hello, In order to get selected value, I would recommend you to handle SelectionChanged event which will fire when post back is caused after selection is made as shown below:
protected void WebDropDown1_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e)
{ string nwsel= e.NewSelection.ToString(); }
I hope this helps.
Please consider following scenario:
User selects something on grid, selection causes postback we have selected row ID.Combo is filled with data from datasource which took selected row id as a query parameter.
From customer point of view combo is showing something, so there is no need to perform a selection, no event is triggered to be handled.Customer clicks something else, code behind checks that there is nothing selected in combo. We show error msg - "please select item in combo"
"Hey, what the heck!?" customer asks - "I do see some selection in combo, why should I click it again?!".
Customer is right. Always right.Customer is annoyed and reports error to me.
What should I do - combo shows selection when datasource is filled, but selected item is null.