Hello,
i have this javascript code
With this :
and this
The problem is that in my javascript function, the "id" is ALWAYS undefined, i'm unable to access the "Attribute" value i have set in the codebehind method.
How can i do this ?
Thank you
i have this javascript code
| function AccesDirectFicheCadre() { |
| var cb = $find("<%= AccesDirect_List.ClientID %>"); |
| var item = cb.get_selectedItem(); |
| var id = item.get_attributes().getAttribute('Id'); |
| // Some other actions using "id", but "id" is ALWAYS undefined... :( |
| } |
With this :
| <telerik:RadComboBox |
| runat="server" ID="AccesDirect_List" OnClientItemsRequested="OnClientItemsRequested" |
| ShowDropDownOnTextboxClick="false" |
| MarkFirstMatch="true" |
| EnableVirtualScrolling="true" NoWrap="true" MaxHeight="210px" |
| EnableLoadOnDemand="true" |
| HighlightTemplatedItems="true" EnableViewState="false" |
| OnItemDataBound="RadComboBox1_ItemDataBound" |
| OnItemsRequested="RadComboBox1_ItemsRequested"> |
| </telerik:RadComboBox> |
and this
| protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e) |
| { |
| //set the Text and Value property of every item |
| //here you can set any other properties like Enabled, ToolTip, Visible, etc. |
| e.Item.Text = ((DataRowView)e.Item.DataItem)["Nom"].ToString(); |
| e.Item.Value = ((DataRowView)e.Item.DataItem)["Id_Cadre"].ToString(); |
| e.Item.Attributes["Id"] = ((DataRowView)e.Item.DataItem)["Id_Cadre"].ToString(); |
| } |
The problem is that in my javascript function, the "id" is ALWAYS undefined, i'm unable to access the "Attribute" value i have set in the codebehind method.
How can i do this ?
Thank you