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

Customize icons instead of expand and collpase images

4 Answers 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sudheer
Top achievements
Rank 2
sudheer asked on 06 Mar 2009, 03:41 PM
Hi all

How to apply customize icons in instead of expand and collapse icons in hierarchical grid.

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Mar 2009, 12:31 PM
Hello Sudheer,

You can use the RadGrid's ColumnCreated event, check in the event arguments whether the column is GridExpandColumn and if so, set the ExpandImageUrl and CollapseImageUrl properties. These two properties work only if you set them programmatically.

    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridExpandColumn)
        {
            (e.Column as GridExpandColumn).ButtonType = GridExpandColumnType.ImageButton;
           
            (e.Column as GridExpandColumn).ExpandImageUrl = ".....";
            (e.Column as GridExpandColumn).CollapseImageUrl = ".......";
        }
    }


Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
sudheer
Top achievements
Rank 2
answered on 07 Mar 2009, 02:51 PM
Hi Dimo,

Thanks alot , really ur reply helped me very much.
0
sudheer
Top achievements
Rank 2
answered on 08 Mar 2009, 03:29 PM
Hi Dimo,

I need same solution in  groupbyexpression grid also , to acheive that i used the below code .
 protected void ProjectListGrid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
    {  
        if (e.Column is GridGroupSplitterColumn)  
        {  
            //(e.Column as GridGroupSplitterColumn).ColumnType =  GridExpandColumnType.ImageButton;  
 
            (e.Column as GridGroupSplitterColumn).ExpandImageUrl = "~/App_Themes/images/SinglePlus.gif";  
            (e.Column as GridGroupSplitterColumn).CollapseImageUrl = "~/App_Themes/images/SingleMinus.gif";  
        }  
    } 
 it's working but on mouseover hand symbol is not coming ,how can i acheive .pls guide
0
Princy
Top achievements
Rank 2
answered on 09 Mar 2009, 06:26 AM

Hi sudheer,

I have tried your code using latest latest version and old version, with and without using the skin for RadGrid and found that it is working fine for me. I am getting the mousehover cursor image without any issue. Could you provide more information about the ASPX of RadGrid that you tried?

Thanks,
Princy.

Tags
Grid
Asked by
sudheer
Top achievements
Rank 2
Answers by
Dimo
Telerik team
sudheer
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or