This is a migrated thread and some comments may be shown as answers.

RadComboBoxItem Attributes

2 Answers 67 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 2
Phil asked on 15 Feb 2011, 08:24 PM
Hi:

I have  a RadComboBox that is using an ItemTemplate.
<telerik:RadComboBoxItem Value="0" Text="Report 1" ReportName="Report 1" About="Select product(s) and view details" Dir="/Invent/" Prompts="False"></telerik:RadComboBoxItem>

I was hoping to use this as a repository per my reports.  Is there a way to get to the various attributes.

Phil

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 16 Feb 2011, 06:28 AM
Hello,


You could use the "Custom Attributes" for RadComboBoxItem to expand the information stored with the items.
Custom Attributes
ItemDataBound


-Shinu.
0
Phil
Top achievements
Rank 2
answered on 16 Feb 2011, 02:59 PM
Thanks...
So:
protected void  cboReport_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
    int _idx = cboReport.SelectedIndex;
    RadComboBoxItem _ri = cboReport.Items.Item(_idx);
    string _reportName = _ri.Attributes("ReportName");
    string _about = _ri.Attributes("About");
}
or ..
Protected Sub cboReport_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cboReport.SelectedIndexChanged
    Dim _idx As Integer = cboReport.SelectedIndex
    Dim _ri As RadComboBoxItem = cboReport.Items.Item(_idx)
    Dim _reportName As String = _ri.Attributes("ReportName")
    Dim _about As String = _ri.Attributes("About")
End Sub
Tags
ComboBox
Asked by
Phil
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Phil
Top achievements
Rank 2
Share this question
or