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

Cannot override default grouping expand and collapse images

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lorraine Pritchard
Top achievements
Rank 1
Lorraine Pritchard asked on 11 Aug 2008, 05:43 PM
Hi,

I have a grid with grouping enabled, using the default skin. I am trying to replace the images on the buttons to expand and collapse a group with more standard plus and minus images. I'm not having a great deal of success though.

I assumed that it would be as simple as setting the ExpandCollapseColumn-CollapseImageUrl and ExpandCollapseColumn-ExpandImageUrl properties, but that is having no impact.

I have been able to change the images by creating an OnColumnCreated event and setting the ExpandImageUrl and CollapseImageURL properties on the GridGroupSplitterColumn. But when I do that, the buttons are being rendered as IMG rather than INPUT tags.

Am I doing something fundamentally wrong?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Aug 2008, 05:41 AM
Hi Lorraine,

The expand/collapse column is used for hierarchical grid and represents the first column in the grid in such case. When you enable the grouping feature of the control the grid will add automatically GridGroupSplitterColumn to its structure. I tried setting the expand-collapse ImageUrl for the GridGroupSplitterColumn in the code behind and it is working as expected.

CS:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridGroupSplitterColumn) 
        { 
            GridGroupSplitterColumn GrpSpltrCol = (GridGroupSplitterColumn)e.Column; 
            GrpSpltrCol.ExpandImageUrl = "RadControls/Images/Image1.gif"
            GrpSpltrCol.CollapseImageUrl = "RadControls/Images/Image2.gif";"; 
        } 
    } 

Thanks
Shinu
Tags
Grid
Asked by
Lorraine Pritchard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or