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

Hierarchical grid - accessing cells

4 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samantha
Top achievements
Rank 1
Samantha asked on 03 Oct 2008, 12:47 AM
I have some data that I am displaying in a child detail grid.  The data in one column is encrypted in the database.  I need to decrypt the data using a method in my code for display in the grid.  How can I accomplish this?

4 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 03 Oct 2008, 05:54 AM
Hello Samantha,

You can use ItemDataBound where you have access to the item object in your collection via e.Item.DataItem.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Samantha
Top achievements
Rank 1
answered on 03 Oct 2008, 11:14 AM
I usually do the following for a regular grid:

GridDataItem gridItem = e.Item as GridDataItem;

if (e.Item is GridDataItem)
{
foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
{


How do I access the detail columns?

0
Vlad
Telerik team
answered on 03 Oct 2008, 11:31 AM
Hello Samantha,

In ItemDataBound you can access both master and detail items.

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shinu
Top achievements
Rank 2
answered on 03 Oct 2008, 12:29 PM
Hi Samantha,

You can use the Name property to access the detail table in the ItemDataBound event.

CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item.OwnerTableView.Name == "Detail1") 
        { 
            foreach (GridColumn col in RadGrid1.MasterTableView.DetailTables[0].RenderColumns) 
            {  
               
            } 
        } 
    } 


Cheers
Shinu.
Tags
Grid
Asked by
Samantha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Samantha
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or