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

Is it possible to change background color of the main table cells when collapsing a row?

2 Answers 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ted
Top achievements
Rank 1
Ted asked on 18 Nov 2008, 01:14 AM
In our grid, the master table view has a detailed table view. So for each row in the master table, there is a detailed table. When expanding the detailed table, the background color in some cells of the parent item will be changed based on some logic in the ItemDataBound event handler. My question is, is it possible to change the background color in the parent cells when collapsing a detailed table? I tried in ItemCreated event handler but got no luck. Looks like it is always using the viewstate to render the grid. Any thoughts? Thanks a lot!

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 18 Nov 2008, 05:24 AM
Hi Ted,

Try the following code snippet to achieve the desired scenario.

CS:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if ((e.CommandName == "ExpandCollapse")&&(e.Item.Expanded)) 
        { 
            e.Item.BackColor = System.Drawing.Color.Red; 
        } 
    } 



Thanks
Shinu.
0
Ted
Top achievements
Rank 1
answered on 18 Nov 2008, 05:32 PM
That resolved my issue. Thanks!
Tags
Grid
Asked by
Ted
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ted
Top achievements
Rank 1
Share this question
or