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

[Solved] retrieve hidden columns values in updatecommand of radgrid

1 Answer 257 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arun Selvarangam
Top achievements
Rank 2
Arun Selvarangam asked on 20 May 2008, 02:36 AM
hi anyone have idea about how to read the values of a hidden column in radgrid using updatecommand event? i have some hidden columns and need to retrieve those values when i click update link. (update cancel)

any help would be greatly appreciated.

Arun.K.S

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 May 2008, 05:22 AM
Hi Arun,

Try setting the hidden field as the DataKeyName and access it in the UpdateCommand as shown below.

ASPX:
<MasterTableView   DataKeyNames="Reg"   Name="Master"     > 


CS:
 protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
    { 
         
        GridEditableItem editedItem = (GridEditableItem)e.Item; 
        
        //Get the hidden field value using the DataKeyValue.      
        string Reg = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Reg"].ToString(); 
    } 


Thanks
Shinu.

Tags
Grid
Asked by
Arun Selvarangam
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or