In Edit FormTemplate, how do I change a parameter of a datasource for a RadComboBox

2 posts, 1 answers
  1. David O'Leary
    David O'Leary avatar
    19 posts
    Member since:
    Jul 2005

    Posted 20 Mar 2012 Link to this post

    For my RadGrid, I have an edit FormTemplate that contains a RadComboBox that needs to change the options available based on one of the columns of the Row being edited. I've got an ObjectDataSource hooked up to the RadComboBox but I'm not sure how I can change the parameter of the ObjectDataSource so it shows the proper list of options.

    Any suggestions or code samples for this?
  2. Answer
    Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 20 Mar 2012 Link to this post

    Hi David,

    You should be able to achieve this in the RadGrid's ItemCommand event.

    I hope this helps!
    Casey

    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
       if(e.CommandName == "Edit")
       {
          GridDataItem dataItm = e.Item as GridDataItem;
          ObjectDataSource1.SelectParameters["Parameter"].DefaultValue = dataItm["ColumnUniqueName"].Text;
          ObjectDataSource1.DataBind();
       }
    }
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top