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

fill textbox on dropdown selectIndexChanged in RadGrid

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 1
Ajay asked on 02 Jan 2013, 11:32 AM

I want to do something like
"Fill Textbox of bound column in Add new Iten Mode on Dropdown selectIndexChanged in RadGrid.

e.g.  When I Click ADD NEW ITEM then Row with input controls will displayed. when I change DDL's value then according it all other textbox (whatever) will filled.

My Que. is How to get that Controls in DDL's SelectIndexChanged Event ??

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jan 2013, 12:40 PM
Hi,

Please try the following code snippet to access the TextBox in the insert form on DDL's SelectedIndexChanged event.

C#:
void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
        DropDownList dropdown = (DropDownList)sender;
        GridEditFormInsertItem inseritem = (GridEditFormInsertItem)dropdown.NamingContainer;
        TextBox txt = (TextBox)inseritem["UniqueName"].Controls[0]; //Access the TextBox here
}

Thanks,
Princy.
0
Ajay
Top achievements
Rank 1
answered on 03 Jan 2013, 04:59 AM
Hey Princy ,

Thanks  For Reply.

I have got solution like below..    And I got idea from your reply..

void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
        DropDownList dropdown = (DropDownList)sender;
           GridDataInsertIteminseritem = (GridDataInsertItem)dropdown.NamingContainer;
        TextBox txt = (TextBox)inseritem["UniqueName"].Controls[0]; //Access the TextBox here
}

Tags
Grid
Asked by
Ajay
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ajay
Top achievements
Rank 1
Share this question
or