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

Readonly Column at run time

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 15 Sep 2015, 12:49 AM
Hi There
I have a bit odd requirement inside a grid. What I am looking for is.
I have grid which consist of Year column and all the 12 month(July, August,….June) and total Budget amount.
This grid could have many rows for different phases of the project (Concept, Design, Construction etc)
Now my task is do the phasing for that budget at runtime.
 At run time I know which months (based on Dates Stored somewhere) I need to put the budget and based on that I have to divide this amount into these months and make all other month as read only.
I have to make sure that sum of all the month should be equal to total budget amount at client side
For example first row might be Design which might start from August and finish at October so remaining column for other months should be read only
Second row might be construction which might start from October and finish at December so remaining column for other months should be read only.
I hope this would be clear enough
Please let me know how to achieve this.
I will really appreciate that and look forward to hear from you all
Many thanks
Syed

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Sep 2015, 10:54 AM
Hello Syed,

You can achieve this requirement using the ItemDataBound event handler provided by RadGrid. Just access the generated controls in edit mode:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

And get the information you need to determine whether the column should be readonly or not:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-raw-field-data-and-key-values

Then, depending on this information, you can set the hide the controls or their parent cells altogether.

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Syed
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or