Here's my scenario:
I have a DataTable with 3 fields:
- Master_Idx
- Description
- LevelIdx
In the RadComboBox I wish to display two columns:
- Description
- A special calculated field which stems from LevelIdx
So in the layout page I've defined the RadComboBox like this:
<telerik:RadComboBox ID="radListBox" runat="server" OnSelectedIndexChanged="radListBox_SelectedIndexChanged">
<ItemTemplate>
<table>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
<td><%# GetPass_ContractLevel(Convert.ToInt32(Container.DataItem, "LevelIdx"))) %></td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
In my server-side code I'm populating the RadComboBox like this:
radList.DataSource = dataTable;
radList.DataTextField = "Description";
radList.DataValueField = "Master_Idx";
radList.DataBind();
for (int i = 0; i < radList.Items.Count; i++)
{
radList.Items[i].DataBind();
}
The problem is that the LevelIdx value being passed to the server-side method "GetPass_ContractLevel" is always zero. However, I've successfully implemented "helper" methods like this before which are called from the layout code. It doesn't seem to be working in this case though.
What am I doing wrong?
Robert