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

Retrieving value from RadGrid in editmode on a external button click

3 Answers 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Haderach
Top achievements
Rank 1
Haderach asked on 28 Feb 2011, 10:56 AM
Hello,

I am using a RadGrid in edit mode with only 2 columns in not ReadOnly.
These 2 columns contain RadTextBox in EditTemplate.
The RadGrid columns can be reorder by the user.

The user can type a value in these RadTextBox and valid the whole RadGrid by clicking a classic button outside the RadGrid.

On the click button event, I am retrieving the values using this code :
TextBox txtBox = (TextBox)item.Cells[14].Controls[0];

My problem is to know the index in the Cells collection...
Is there a solution the get the cells index using the uniqueName of columns? or any other solution without fixed cells numbers?


Thank you for helps,
Read you soon.


3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 28 Feb 2011, 11:44 AM
hi Haderach,
RadNumericTextBox txtAmountPaid = (RadNumericTextBox)radgrdFees.Items[radgrdFees.EditIndexes[0]].EditFormItem.FindControl("txtAmountPaid");

thanks,
Jayesh Goyani
0
Haderach
Top achievements
Rank 1
answered on 28 Feb 2011, 11:48 AM
Thank you for your answer but my problem is not to find the EditIndexes because all my Items are editable but to find the cells (columns) index....

And... sorry because I did not precise but I am not in EditForm but in InLine edit.


0
Haderach
Top achievements
Rank 1
answered on 01 Mar 2011, 09:15 AM
I have found how to do what I wanted :

RadNumericTextBox radNumTxtBx = (RadNumericTextBox)item.EditManager.GetColumnEditor("Valeur").ContainerControl.FindControl("RadNumericTextBox1");

GetColumnEditor get the column with its UniqueName.


Tags
Grid
Asked by
Haderach
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Haderach
Top achievements
Rank 1
Share this question
or