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

Sorting whithout marking sorted column

6 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tomasz M.Lipiński
Top achievements
Rank 1
Tomasz M.Lipiński asked on 22 Jan 2010, 02:00 PM
Hi,

Out-of-the-box marking sorted columns (with special "up" and "down" icons) looks well but requires a lot of space (it is especially significant in the case of a narrow, icons only containing column). I would like to be able to sort columns but without any marking.
First, I've removed images:
div.RadGrid .rgHeader .rgSortDesc  
{  
  width0px;  
  height1px;  
  background-imagenone;  
(the same for rgSortAsc).
It works perfect under IE7 and Opera. But in this case, there is a button added (when the column is sorted in any direction); this button has its caption made of a single space character. It is perfectly invisible under these two browsers but under any other one it still occupies some additional space.
Important: I'm using the "Simple" skin.
Can I do anything to leave the header of the sorted column unchanged?

Best regards
Tomasz

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Jan 2010, 08:09 PM
Hello Tomasz,

Please set the table layout of your MasterTableView to Fixed and then try the same CSS snippet:
div.RadGrid .rgHeader .rgSortDesc,
div.RadGrid .rgHeader .rgSortAsc
{
    background-image: none;
    width: 1px;
}

<MasterTableView TableLayout="Fixed" ...

Let me know whether this helps.

Best regards,
Daniel
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
Tomasz M.Lipiński
Top achievements
Rank 1
answered on 22 Jan 2010, 10:31 PM
Hi,
No, it doesn't work.
I've even added the following rule:
div.RadGrid .rgHeader input[type="button"].rgSortDesc,   
div.RadGrid .rgHeader input[type="button"].rgSortAsc  
{  
  displaynone;  
The "accused" :-) button has vanished but the header's icon has remained shifted. I've done some more investigations and it seems that something else is responsible. The structure of the header is the following:
<th ....> 
<input type="image" .... /> 
&nbsp;
<input type="button" value=" " class="rgSortAsc" .... />
</th> 
"&nbsp;" remains as the source of the problem. And it seems to be difficult to remove it (by myself) .... Am I right?

Regards
Tomasz
0
Daniel
Telerik team
answered on 26 Jan 2010, 05:54 PM
Hello Tomasz,

Please download the attached demo and let me know whether it works properly on your end.

Kind regards,
Daniel
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
Tomasz M.Lipiński
Top achievements
Rank 1
answered on 26 Jan 2010, 10:19 PM
Hi,
Your demo works fine but if you put an icon in the header (instead of the text) the grid starts to behave as I've described.
Now I see that I haven't stated clearly that the tested column should be as narrow as possible and contain an icon only in its header (HeaderURL instead of HeaderText).

Regards
Tomasz
0
Accepted
Daniel
Telerik team
answered on 01 Feb 2010, 01:28 PM
Hello Tomasz,

Thank you for the clarification.

I modified the demo according your requirements.

Regards,
Daniel
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
Tomasz M.Lipiński
Top achievements
Rank 1
answered on 02 Feb 2010, 11:31 AM
Hi,

OK, it works well.
Your solution requires some refinement, of course (in real cases it removes also useful things :-); it seems that it is enough to remove "&nbsp;" literals only). But generally this is what I wanted.

Thank you.

Regards
Tomasz
Tags
Grid
Asked by
Tomasz M.Lipiński
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Tomasz M.Lipiński
Top achievements
Rank 1
Share this question
or