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

[Solved] Editable radgrid, confirm with one button

2 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benny Van Gorp
Top achievements
Rank 1
Benny Van Gorp asked on 14 Oct 2009, 08:37 AM
Hello,

I have a Radgrid with columns added at runtime. 2 columns of these columns are editable by the user.

It's necessary to have the whole grid in Edit mode (Inline updatable) and that's done with following code:

for (int i = 0; i < RadGridArtiTree1.PageSize; i++) 
    RadGridArtiTree1.EditIndexes.Add(i); 

The user can confirm the data in the grid with one button and that's where I'm having troubles.

I can retrieve the updated values with this code:
int numberTrays = 0; 
int numberPallets = 0; 
 
foreach (GridEditableItem editedItem in RadGridArtiTree1.EditItems) 
    Hashtable newValues = new Hashtable(); 
    RadGridArtiTree1.MasterTableView.ExtractValuesFromItem(newValues, editedItem); 
 
    numberTrays = Convert.ToInt16(newValues[OrdasRefs.dTRAYS]); 
    numberPallets = Convert.ToInt16(newValues[OrdasRefs.dPALLETS]); 
 

But I also need to get other values for the editeditem.
editedItem["ARTNR"].Text returns "&nbsp;" so can anyone give me an solution how to get the value of a certain readonly column in the edited row?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 Oct 2009, 09:45 AM
Hello Benny,

I suppose you want to access the values of cells which are not editable. If that is the case, you can assign the datafield of the non editable column as the Datakeyname of the RadGrid and then access the value using the datakeyvalue property for items in the grid. You will find this explained in the help document below:
Retrieving primary key field values for selected items

Thanks
Princy.
0
Benny Van Gorp
Top achievements
Rank 1
answered on 14 Oct 2009, 11:47 AM
Thank you very much, this was exactly what I was looking for.

Tags
Grid
Asked by
Benny Van Gorp
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Benny Van Gorp
Top achievements
Rank 1
Share this question
or