Hi,
i need a radcombobox populated by a class, on itemrequested
On ANCLI0 class i have:
if my combobox is a simple one (without itemtemplates), it works fine, but if i have templated items like following:
when i click on my combo, it don't show me values on its rows.... i think there's a problem with databindings, i try differents databindings (see code above), but it neve shows me "Text" or "Indirizzo" Values...
Someone coul help me??
thanks in advance!
i need a radcombobox populated by a class, on itemrequested
| protected void frmIdCliente_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
| { |
| string text = e.Text; |
| frmIdCliente.Items.Clear(); |
| ANCLI0.PopolaRadCombo(ref frmIdCliente, text, "C", 10); |
| } |
| public static void PopolaRadCombo(ref RadComboBox ComboBoxToPopulate, String Filter, String FLCLF, Int32 NumeroRisultati) |
| { |
| RadComboBoxItem Cliente; |
| ANCLI0 xxx = new ANCLI0(); |
| Hashtable Hashclienti = xxx.Cerca(Filter.ToString(), NumeroRisultati, "OMBBG", FLCLF); |
| foreach (DictionaryEntry Entry in Hashclienti) |
| { |
| xxx = new ANCLI0(Entry.Key.ToString()); |
| Cliente = new RadComboBoxItem(); |
| Cliente.Text = xxx.DescrizioneCompleta; |
| Cliente.Value = Entry.Key.ToString(); |
| Cliente.Attributes.Add("Indirizzo", xxx.IndirizzoCompleto); |
| //se cliente non accetta ordini lo evidenzio in rosso |
| if (xxx.ANCLI0_ACCOR == "NO") |
| { |
| Cliente.BackColor = System.Drawing.Color.Red; |
| Cliente.Enabled = false; |
| } |
| ComboBoxToPopulate.Items.Add(Cliente); |
| } |
| ComboBoxToPopulate.SortItems(); |
| } |
if my combobox is a simple one (without itemtemplates), it works fine, but if i have templated items like following:
| <telerik:RadComboBox ID="frmIdCliente" runat="server" AllowCustomText="True" EnableLoadOnDemand="True" |
| HighlightTemplatedItems="true" MarkFirstMatch="True" |
| OnItemsRequested="frmIdCliente_ItemsRequested" |
| SkinsPath="~/RadControls/ComboBox/Skins" Width="150px" Skin="WebBlue"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| <ItemTemplate> |
| <table style="width:300px;border-bottom:1px solid black;padding:5px 0 5px 0;" cellspacing = 0 cellpadding = 0 class="normal"> |
| <tr> |
| <td style="width:150px; text-align: left"> |
| <asp:Label ID="Label1" runat="server" Text='<%# Eval("Text") %>'></asp:Label> |
| </td> |
| <td style="width:150px; text-align: left"> |
| <%# DataBinder.Eval(Container.DataItem, "Text")%> |
| <%# DataBinder.Eval(Container, "Attributes['Indirizzo']")%> |
| <%# DataBinder.Eval(Container.DataItem, "Attributes 'Indirizzo']")%> |
| <%# Container.Attributes["Indirizzo"].ToString() %> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
Someone coul help me??
thanks in advance!