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

Access ReadOnly control in RadGrid

2 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 29 Nov 2010, 02:46 PM
How can I access the value of a READONLY control in a RadGrid?

I tried the code below but it could not find the control.

RadGrid1.items.FindControl("controlename")

However, when I remove the READONLY  property, I am able to find the control.

I will appreciate any help asap.

Thanks
Jeff

2 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 29 Nov 2010, 06:15 PM
Hello Jeffrey,

As far as I understand you need to get the value of the read-only control when an item is put into edit mode. In this case, you can use either of the following approaches:

1. Add the name of the column's DataField to the DataKeyNames of the MasterTableView and then call the GetDataKeyValue method of the grid's edit form item:
for example: ((GridEditableItem)e.Item).GetDataKeyValue("ProductID")

2. Or alternatively, you can use the ExtractValues method of the above item after setting beforehand for the column:  ForceExtractValue="Always".

Hope this information will prove helpful.

Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jeffrey
Top achievements
Rank 1
answered on 29 Nov 2010, 07:20 PM
Hi Tsvetoslav,

Thanks for the response. I truly appreciate. Although your response did not quite help me, I figured out my issue.

Jeff
Tags
Grid
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Jeffrey
Top achievements
Rank 1
Share this question
or