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

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

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David O'Leary
Top achievements
Rank 2
David O'Leary asked on 20 Mar 2012, 05:57 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Casey
Top achievements
Rank 1
answered on 20 Mar 2012, 08:50 PM
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();
   }
}
Tags
Grid
Asked by
David O'Leary
Top achievements
Rank 2
Answers by
Casey
Top achievements
Rank 1
Share this question
or