I have tried everthing to get the SelectedValue of a radCombo to work, but it always seems to have a value of "1".
I have a simple scenario, a radcombo in ASP.FormView in edit mode.
The combo definition looks like:
The list populates correctly.
First I tried to set the value this way:
With no results. Next attempt was with code-behind:
Setting the value from the DataRowView (null) or forcing a value to "3" had no effect, SelectedItemValue was always "1"
Any ideas?
Update: The first scenario worked OK except for nul values from the database. Is there a way to show the empty message for nulls?
I have a simple scenario, a radcombo in ASP.FormView in edit mode.
The combo definition looks like:
<telerik:RadComboBox ID="EmployeePotentialCombo" runat="server" DataSourceID="EmployeePotentialList" DataValueField="eptID" Text="Employee Potential:" DataTextField="eptDesc" Width="350px" EmptyMessage="Select Employee Potential" Label="Potential:"> </telerik:RadComboBox>The list populates correctly.
First I tried to set the value this way:
<telerik:RadComboBox ID="EmployeePotentialCombo" runat="server" DataSourceID="EmployeePotentialList" DataValueField="eptID" Text="Employee Potential:" DataTextField="eptDesc" Width="350px" EmptyMessage="Select Employee Potential" Label="Potential:" SelectedValue='<%# Bind("eptID") %>'> </telerik:RadComboBox>With no results. Next attempt was with code-behind:
protected void FormView1_DataBound(object sender, EventArgs e) { DataRowView drv = (DataRowView)FormView1.DataItem; RadComboBox combo = (RadComboBox)FormView1.FindControl("EmployeePotentialCombo"); combo.SelectedValue = drv["eptID"].ToString(); // combo.SelectedValue = "3"; }Setting the value from the DataRowView (null) or forcing a value to "3" had no effect, SelectedItemValue was always "1"
Any ideas?
Update: The first scenario worked OK except for nul values from the database. Is there a way to show the empty message for nulls?