Get GridDropDownColumn Text on insert

2 posts, 1 answers
  1. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 03 Apr 2013 Link to this post

    Hi,

    I am using the RadGrid control which has a GridDropDownColumn. In the insert form, I want to fetch the GridDropDown selected text and assign it to a session variable. How can I get the selected text from the GridDropDown on insert?

    Thank You
    Sameer
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Apr 2013 Link to this post

    Hi Sameer,

    Please have a look into the following C# code.

    C#:
    protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
    {
        GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
        RadComboBox combo = (RadComboBox)item["DropDownListColumn"].Controls[0];
        Session["comboBoxText"] = combo.SelectedItem.Text;
    }

    Thanks,
    Princy.
Back to Top