Home Forums WinForms controls Xceed Grid for WinForms Remove sort indicator image from column header.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15316 |

    Is there a way to remove the sort indicator image from teh column header? I still want to be able to click on the header and sort, but I don’t want the up or down arrow to appear. I have a column that is very narrow and the direction indicator is getting in the way.

    Imported from legacy forums. Posted by Marvin (had 2945 views)

    User (Old forums)
    Member
    Post count: 23064

    You will need to derive from the ColumnManagerRow and ColumnManagerCell to accomplish this.

    Since the paint is done through layers, it should look ok, except that you will loose the cells borders. If you want them, you will need to paint them manually by overriding PaintBorders of ColumnManagerCell.

    public class MyColumnManagerCell : ColumnManagerCell
    {
    public MyColumnManagerCell( Column parentColumn )
    : base( parentColumn )
    {
    }

    protected MyColumnManagerCell( MyColumnManagerCell template )
    : base( template )
    {
    }

    protected override void PaintBackground( GridPaintEventArgs e )
    {
    }

    protected override Cell CreateInstance()
    {
    return new MyColumnManagerCell( this );
    }

    }

    public class MyColumnManagerRow : ColumnManagerRow
    {
    public MyColumnManagerRow()
    {

    }

    protected MyColumnManagerRow( MyColumnManagerRow template )
    : base( template )
    {
    }

    protected override Row CreateInstance()
    {
    return new MyColumnManagerRow( this );
    }

    protected override Cell CreateCell( Column parentColumn )
    {
    return new MyColumnManagerCell( parentColumn );
    }

    }

    Imported from legacy forums. Posted by André (had 2817 views)

    User (Old forums)
    Member
    Post count: 23064

    Is this still the case, or is there now a property to hide the image? Not having the sort indicator is a common need for narrow columns (ala Outlook). Thanks.

    Greg

    Imported from legacy forums. Posted by Greg (had 355 views)

    User (Old forums)
    Member
    Post count: 23064

    This is still the case.

    Imported from legacy forums. Posted by André (had 290 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, Andre. Is it on your backlog to allow turning off the indicator on a column?

    Imported from legacy forums. Posted by Greg (had 278 views)

    User (Old forums)
    Member
    Post count: 23064

    Not at this point, since there is a relatively simple workaround to do this.

    Imported from legacy forums. Posted by André (had 499 views)

    User (Old forums)
    Member
    Post count: 23064

    Looking at the code I have it doesn’t allow this. Is this correct?

     I do not see the ColumnManagerCell constructer that accepts a column.

     I am using version 2.0

    Imported from legacy forums. Posted by William (had 267 views)

    User (Old forums)
    Member
    Post count: 23064

    Do you mean in the CreateCell() method?  Do you define this constructor in the derived ColumnManagerCell class?

    Note that you are using a quite old version, but I think it should still work.  This code is good and works fine in more recent version for sure.

    Imported from legacy forums. Posted by André (had 1089 views)

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.