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

RAd Grid Event

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bharat
Top achievements
Rank 1
Bharat asked on 18 Oct 2010, 07:38 AM
Hi,

On which eventof the RAD Grid, we can get the value of the cell in the RAD grid?

Thank yoy

Bharat Singh

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 18 Oct 2010, 11:48 AM
Hello Bharat,

There are a lot of ways you can do this depending on the specific scenario (whether you want to do it client-side or on the server, whether the grid is display or edit mode etc.) Basically the main principle is the same: you pick an event called for each item in the grid (ItemCreated/ItemDataBound), access the desired column by its column unique name and get the text value of the returned TableCell object. Here is sample code showing this approach:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        // the case for items in normal mode
        if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = e.Item as GridDataItem;
            TableCell cell = dataItem["ColumnUniqueName"]; //where dataItem is object of type GridDataItem
            string cellValue = cell.Text; //the value of the cell
        }
    }


For more information on concrete cases please check the following help topic.

All the best,
Marin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Bharat
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or