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

[Solved] Selecting which Edit Template controls to show programmatically

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 28 Sep 2011, 06:39 PM
Hi

I am working on a grid that allows for in-line editting and I'm using edit templates.

I have a couple of columns that are inter-related.

The first column allows the user to pick from one of three choices when in edit mode,

No Sort, Sort Ascending, or Sort Descending. I am using a ComboBox in this column's ItemTemplate.

The second column allows the user to determine the sort precidence, 1, 2, 3, etc.
For this column I am using a NumericTextBox with SpinUp and SpinDown buttons.

If the first column has 'No Sort' as its value I would like to prevent the Edit Control for the second
column from appearing when I put the row into edit mode.

I have managed to create some client-side code that hides and shows the NumericTextBox and its spin buttons
and I invoke this code on a selection change in the first column's ComboBox. This works acceptably.

However I have been unable to come up with a method for not showing the NumericEditControl when
I put the row into edit mode.

Any ideas on how to do this with client, or server side could wold be a great help.

THX

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 29 Sep 2011, 12:23 PM
Hello Tim,

In order to implement the desired functionality, I recommend that you handle the ItemDataBound event and if the item is the edit form, check the value of the first columns and hide the numeric text box, if necessary.
Please examine the following resources for additional information:
Accessing Cells and Rows
Distinguishing the major differences between ItemCreated and ItemDataBound events

I hope this helps.

Greetings,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or