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

Group by images show as plain HTML buttons

5 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dragan
Top achievements
Rank 1
Dragan asked on 14 Jan 2010, 01:54 PM
I have a grid with the "Office2007" skin on it. Styling works very fine in all aspects except the grouping images.
Namely, when I drag a column to use it as being grouped by, on top I get the title of the column, and next to it two HTML buttons, first one for sort, and second one to ungroup. The problem is that both come without an image as opposed to any other item of the grid (filter, expand/collapse, column sort) whose images are properly displayed.
I can't seem to find the property to attach declaratively an image for the grouping buttons. Please help!

In addition, how can I cancel the sort of a column, for example after I have clicked sort ascending and descending once, and then the third time I would like that the column goes back to the normal, "sortless" arrangements? 

Thank you so much.

lektira

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Jan 2010, 01:57 PM
Hello Lektira,

The described problem with ungroup buttons is not exhibited on a simple standalone page (see below). Are you using a custom skin for the RadGrid control? If yes, probably it lacks styles for the ungroup button and you need to add a background image manually by using the .rgUngroup CSS class.

With regard to sorting, I hope you are not talking about the grouped data sorting, as it cannot be disabled - grouped data is always sorted by the grouped field(s).

On the other hand, the standard column sorting is toggled in the following order:

none > ascending > descending > none > ...


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<script runat="server">
 
    protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = new DataTable();
        DataRow dr;
        int colsNum = 4;
        int rowsNum = 5;
        string colName = "Column";
 
        for (int j = 1; j <= colsNum; j++)
        {
            dt.Columns.Add(String.Format("{0}{1}", colName, j));
        }
 
        for (int i = 1; i <= rowsNum; i++)
        {
            dr = dt.NewRow();
 
            for (int k = 1; k <= colsNum; k++)
            {
                dr[String.Format("{0}{1}", colName, k)] = String.Format("{0}{1} Row{2}", colName, k, i);
            }
            dt.Rows.Add(dr);
        }
 
        (sender as RadGrid).DataSource = dt;
    }
     
</script>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
<head id="Head1" runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="50" BackColor="Yellow" />
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    Width="800px"
    Skin="Office2007"
    GroupingEnabled="true"
    ShowGroupPanel="true"
    AllowSorting="true"
    OnNeedDataSource="RadGrid_NeedDataSource">
    <GroupingSettings ShowUnGroupButton="true" />
    <ClientSettings AllowDragToGroup="true" />
</telerik:RadGrid>
 
 
</form>
</body>
</html>


Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dragan
Top achievements
Rank 1
answered on 18 Jan 2010, 11:34 AM
Hello,

I am not using a custom skin for the grid. In fact, I am using the built in Office2007 skin. And it still does not show the images, but only two blank buttons side by side, one for the selected grouping sort, the other one for ungroup. I am not using the grid in a standalone page, but have a master page attached to it.

As for the sorting functionality itself, I am not talking about the grouped data, but the standard column sorting. I would also expect that the behavior is as you have described it, but mine goes in the following order:

none > ascending > descending > ascending > descending > ascending > descending >... (and never returns to none)

Please help,
Lektira
0
Dimo
Telerik team
answered on 18 Jan 2010, 02:02 PM
Hello Dragan,

In this case I suggest you to prepare a simple demo, which exhibits the described problems, and send it to us via a formal support ticket. We will inspect it locally and provide further advice. Thank you.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dragan
Top achievements
Rank 1
answered on 19 Jan 2010, 09:04 AM
Hi Dimo,

I have actually solved the first problem. I was using Office2007 skin but I forgot to delete the line in the header defining my custom theme. Now the images for group by appear. But I still have that problem with the column sort as it only goes ascending or descending but doesn't get turned off. The code is the same like you have submitted, but still no clue.
Have you ever encountered that?

Thanks,
lektira
0
Dimo
Telerik team
answered on 19 Jan 2010, 03:20 PM
Hi Dragan,

Make sure that you are not setting the AllowNaturalSort property of the MasterTableView to "false" somewhere.

Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Dragan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Dragan
Top achievements
Rank 1
Share this question
or