display multiple columns for the selected row

2 posts, 0 answers
  1. Abby Grant
    Abby Grant avatar
    1 posts
    Member since:
    Jul 2011

    Posted 25 Jul 2011 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Jul 2011 Link to this post

    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.
Back to Top