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

Change the expand collapse icon.

7 Answers 434 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Niraj
Top achievements
Rank 1
Niraj asked on 07 Jan 2011, 11:27 AM

Hi,
Can you suggest me CSS for changing the expand/collapse icon(image)  in RadGrid on grouping for Vista Skin..?

Regards,
Niraj Khose

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Jan 2011, 12:57 PM
Hello Niraj Khose,


The following CSS will be helpful for you in changing the default icons.

CSS:
<style type="text/css"
    .rgCollapse 
    
        background-image: url('../Images/Icons/img1.gif') !important
        background-position: 0px 0px !important
    
    .rgExpand 
    
        background-image: url('../Images/Icons/img2.gif') !important
        background-position: 0px 0px !important
    
</style>




Thanks,
Princy.
0
Niraj
Top achievements
Rank 1
answered on 11 Jan 2011, 07:48 AM
Hi,
I have a problem with this. It is not showing the image that i desired. Instead it has remove the existing image as well. Is there specific size limit for the icon.?
Regards,
Niraj Khose
0
Princy
Top achievements
Rank 2
answered on 11 Jan 2011, 12:58 PM
Hello Niraj,

Please check the image path that you have given in the CSS is correct. Also refer the following forum which explains the same.
Change expand collapse image of radgrid  

Thanks,
Princy.
0
Niraj
Top achievements
Rank 1
answered on 20 Jan 2011, 07:25 AM
Princy,
Its still not working. It is removing the default image. But its not loading the new.
Regards,
Niraj Khose
0
Tsvetina
Telerik team
answered on 25 Jan 2011, 12:32 PM
Hello Niraj,

Could you please paste the CSS that you use and attach the image in question? We will test it on our side to see if there is anything wrong.

All the best,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Niraj
Top achievements
Rank 1
answered on 08 Feb 2011, 08:23 AM
Princy/Tsvetina,
I have attached a aspx,css and the image file to this post , please tell me how can i change my expand/collapse icon in this.??
Your proposed solution does not load the new image to the expand/collapse icon. But it removes the default expand/ collapse icon as i mentioned earlier.
Regards,
Niraj Khose.


ASPX code :

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

 

<head runat="server">

    <title>

   

    </title>

    <link href="~/Styles/StyleSheet1.css" rel="stylesheet" type="text/css" />

 

   

</head>

<body>

 

      <link href="~/Styles/StyleSheet1.css" rel="stylesheet" type="text/css" />

 

   

    <form id="form1" runat="server">

    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">

    </telerik:RadScriptManager>

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"

        AllowPaging="True" AllowSorting="True" GridLines="None"

        ShowGroupPanel="True" onneeddatasource="RadGrid1_NeedDataSource" >

        <ClientSettings AllowDragToGroup="True">

        </ClientSettings>

<MasterTableView>

<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>

 

 

 

<ExpandCollapseColumn >

<HeaderStyle Width="20px"></HeaderStyle>

</ExpandCollapseColumn>

<Columns>

 

</Columns>

 

</MasterTableView>

 

<HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

    </telerik:RadGrid>

    </form>

   

 

   

</body>

</html>



CSS File :


 

        .rgCollapse 

        { 

            background-image: url('~/Images/1294727542_toggle-small-expand.png') !important

            background-position: 0px0px!important

        } 

        .rgExpand 

        { 

            background-image: url('~/Images/1294727542_toggle-small-expand.png') !important

            background-position: 0px0px!important

        } 

 

 

   

0
Pavlina
Telerik team
answered on 11 Feb 2011, 04:40 PM
Hi Niraj,

In order to have custom expand/collapse buttons, you can create the appropriate background images and set them to the following CSS rules:

.RadGrid_SkinName  input.rgExpand
{
         background:url(.....) center center no-repeat;
}

.RadGrid_SkinName  input.rgCollapse
{
         background:url(.....) center center no-repeat;
}

Moreover, I am sending you a simple test project that demonstrates how to achieve your goal. 

I hope this helps. 

All the best,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Niraj
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Niraj
Top achievements
Rank 1
Tsvetina
Telerik team
Pavlina
Telerik team
Share this question
or