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

selectedIndexChanged event in a grid's form template in edit mode

4 Answers 380 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kirk Thomas
Top achievements
Rank 1
Kirk Thomas asked on 09 Oct 2009, 03:02 PM
Hello,

I have a grid with a custom form template that I use for editing.  Inside the template are dropdownlists and textboxes and I see that there aren't any events that I can use when these controls are in the form template.  Is there a way to force an event like selectionIndexChanged or textChanged and if not what event in the grid can I use to manipulate these contols when a user does perform a textChange or selectionIndexChage?

Thanks,
Kirk

4 Answers, 1 is accepted

Sort by
0
Accepted
Thomas Salt
Top achievements
Rank 1
answered on 09 Oct 2009, 03:10 PM
you can link up events directly to the dropdownlists.
Ie:
<asp:DropDownList OnSelectedIndexChanged="myDDL_SelectedIndexChanged" ....
then create the appropriate signature for the event in the code behind
0
Kirk Thomas
Top achievements
Rank 1
answered on 09 Oct 2009, 06:06 PM
Thanks that did work(I should have realized I could do that).  I have another problem now how do I find the controls in the form template in the grid I tried just using RadGrid1.FindControl("Control_ID") but that didn't work.
0
Kirk Thomas
Top achievements
Rank 1
answered on 09 Oct 2009, 07:56 PM
I figured my last question out thanks for the help
0
Atlas
Top achievements
Rank 1
answered on 08 Dec 2012, 12:19 AM
It would be kind of nice if you posted the solution. I am trying to do the same thing.

OK, i found the solution on another post:

protected void ComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
   {
       RadComboBox combo = sender as RadComboBox;
       GridEditableItem item = (GridEditableItem)combo.NamingContainer;
       Label lbl = (Label)item.FindControl("Label1");
       lbl.Text = combo.SelectedValue;
   }
Tags
Grid
Asked by
Kirk Thomas
Top achievements
Rank 1
Answers by
Thomas Salt
Top achievements
Rank 1
Kirk Thomas
Top achievements
Rank 1
Atlas
Top achievements
Rank 1
Share this question
or