Hello,
Using the combox box and populating it from the code behind, where I'm accessing our DAL. Its working ok, however there is no value field being rendered out to the HTML. So when it submits I'm getting the Text field submitted for example '16th century' when I need the value field i.e. '34' (its id number).
Here is a snippet of the rendered HTML:
Can some please explain why the ID field is not being rendered out here?
Many thanks,
Alan
Front End:
Code Behind:
Using the combox box and populating it from the code behind, where I'm accessing our DAL. Its working ok, however there is no value field being rendered out to the HTML. So when it submits I'm getting the Text field submitted for example '16th century' when I need the value field i.e. '34' (its id number).
Here is a snippet of the rendered HTML:
<li class="rcbItem ">15th century</li><li class="rcbItem ">16th century</li>
Can some please explain why the ID field is not being rendered out here?
Many thanks,
Alan
Front End:
<label for="radComboPeriod">Time Period: </label> <telerik:RadComboBox ID="radComboPeriod" Width="300px" Height="140px" EmptyMessage="Type a Period" runat="server"> <ExpandAnimation Type="OutBack" Duration="300" /> <CollapseAnimation Type="InBack" Duration="300" /> </telerik:RadComboBox>
Code Behind:
protected void Load_Periods(bool valpass) { //-- Create the connection- get the details and render them to the Datagrid. p2pDAL crudopsDAL = new p2pDAL(); DataTable result = crudopsDAL.select_periods(); //use method to return all the cats if (!IsPostBack) { radComboPeriod.DataSource = result; radComboPeriod.DataValueField = "PeriodID"; radComboPeriod.DataTextField = "Period"; string rebindValPer = (string)(Session["Period"]); if (valpass == false && rebindValPer != "Type a Period") { radComboPeriod.SelectedValue = rebindValPer; } radComboPeriod.DataBind(); } }