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

Changing controls shown on each cell based on value of another

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob Mulder
Top achievements
Rank 1
Rob Mulder asked on 01 Jun 2010, 10:01 PM

1. I have a grid that is created dynamically where col 1 has a dropdown box. Based on what the user selects in col 1,  I should show either a textbox or dropdownlist or datepicker in col 2. How can I accomplish this?

2. Also how do I handle events when the selecteditem in col 1 changes?

The data isn't coming from a datasource, I'll be creating each row programmatically.

Thanks

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 04 Jun 2010, 12:13 PM
Hello Rob,

Initially, you can render all the required controls in the cell(s), and toggle off the display (true/false) for those which should not be shown initially. Then, you can assign a selectedIndexChanged server side event to the combo box control. From within this event handler, you can reference each cell:

http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

and the controls nested in it, to toggle off their display, depending on the value selected in the combo box.
I hope that this is a feasible approach for you.

Regards,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Rob Mulder
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or