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

rad:GridBoundColumn

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 02 Jun 2008, 08:04 PM
Hello,

I know I saw this answer somewhere, but couldn't find it, can someone point me to the link that has this info:

When using a GridBoundColumn, in the 

RadGrid1_ItemDataBound event for when editing the row,

I need to be able get the value of the original value of the GridBoundColumn.  So, in review, when the grid loads the first time, I have a row of data with a gridbouldcolumn set to a specific data value.  When clicking edit, to edit that row, I need to reference this original gridbouldcolumn value. 

Also looking for how to do this using GridTemplateColumns...I know I saw an example out there,

Thanks much,
John

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jun 2008, 05:54 AM
Hi John,

Try accessing the cell value on clicking the Edit button in the ItemDataBound event using the ColumnUniqueName as shown below.

CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))  
        {  
            GridEditableItem edititem = (GridEditableItem)e.Item;  
            string strtxt = edititem["ColumnUniqueName"].Text.ToString();  
        }  
    } 


Thanks
Princy
Tags
Grid
Asked by
john
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or