Hello Sir,
We set the values inside ItemDataBound even handler after binding it
We use RadComboBox inside RadWindow as the following:
<telerik:RadWindow ID="WinFirms" runat="server" Title="Select Firm" Width="500" Height="200" Behaviors="Move" VisibleStatusbar="false" VisibleOnPageLoad="false" Modal="true" EnableShadow="true" DestroyOnClose="false" Skin="Sunset"> <ContentTemplate> <div style="padding:10px;"> <div style="float:left; width:10px;"> Firm: </div> <div> <telerik:RadComboBox runat="server" ID="ddlFirm" Width="100%" MarkFirstMatch="True" CausesValidation="false" HighlightTemplatedItems="true"> <HeaderTemplate> <table style="width:95%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox"> <tr> <td style="width: 50px">DFSA No</td> <td style="width: 100px">Firm Name</td> <td style="width: 50px">Capacity</td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table style="width:100%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox"> <tr> <td style="width: 20%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "DfsaNo")%> </td> <td style="width: 70%"><%#DataBinder.Eval(Container.DataItem, "DName")%></td> <td style="width: 10%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "Capacity")%></td> </tr> </table> </ItemTemplate> </telerik:RadComboBox> </div> </div> <div style="text-align:center;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Firm is required" Display="Dynamic" ControlToValidate="ddlFirm"></asp:RequiredFieldValidator> <asp:Button runat="server" id="WinOK" OnClientClick="SubmitFirmDialog();return false;" Text="OK" UseSubmitBehavior="False" ValidationGroup="SubmitWindow" CausesValidation="true"/> <asp:Button runat="server" id="WinCancel" OnClientClick="Hide();return false;" Text="Cancel" UseSubmitBehavior="False" /> </div> </ContentTemplate></telerik:RadWindow>We Fill DDL as following
Sub LoadFirmData() ddlFirm.DataSource = FirmDetails.GetAfAspRaFirmByVal() ddlFirm.DataBind()End SubWe set the values inside ItemDataBound even handler after binding it
Protected Sub ddlFirm_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles ddlFirm.ItemDataBound e.Item.Text = e.Item.DataItem.DName e.Item.Value = e.Item.DataItem.PersonID & "%" & e.Item.DataItem.Capacity e.Item.Attributes.Add("FirmID", e.Item.DataItem.PersonID) e.Item.Attributes.Add("Capacity", e.Item.DataItem.Capacity) e.Item.Attributes.Add("DfsaNo", e.Item.DataItem.DfsaNo) End SubFirst page Load the data loads successfully and displayed inside the ComboBox.
When a callback happens the ComboBox loads all data as empty as the following HTML:
<li class="rcbItem rcbTemplate">
<table cellspacing="0" cellpadding="0" class="MultiColumnComboBox" style="width: 100%;">
<tbody><tr>
<td style="width: 20%; color: Gray;"> </td>
<td style="width: 70%;"></td>
<td style="width: 10%; color: Gray;"></td>
</tr>
</tbody></table>
</li>
At the same time when we assess the list items on client side we get the results of (value + attributes) correctly. But its not displayed in the dropdown.