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

display multiple columns for the selected row

1 Answer 76 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Abby Grant
Top achievements
Rank 1
Abby Grant asked on 26 Jul 2011, 01:07 AM
Using this example, http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultcs.aspx

How can I show the all of the columns from the selected row in the dropdown after it has been selected?

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Jul 2011, 07:46 AM
Hello Abby,

You can add CustomAttributes to the RadComboBoxItem to save the column value and access the value in SelectionIndexChanged event. Hope this helps.

C#:
protected void ddlOrgCode_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
{
        DataRowView dataSourceRow = (DataRowView)e.Item.DataItem;
        e.Item.Attributes["FirstName"] = dataSourceRow["FirstName"].ToString();
        e.Item.Attributes["EmployeeID"] = dataSourceRow["LastName"].ToString();
}
protected void ddlOrgCode_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
      Response.Write(ddlOrgCode.SelectedItem.Attributes["FirstName"]);  
}

Thanks,
Princy.
Tags
ComboBox
Asked by
Abby Grant
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or