Home Forums WinForms controls Xceed Grid for WinForms add image with text to Column Header

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

    Hi ,

     

    I want to add image with text on a column header for Xceed .Net grid. is it possible ?

     
    – Amit  

    Imported from legacy forums. Posted by Amit (had 1860 views)

    User (Old forums)
    Member
    Post count: 23064

    You can use the BackgroundImage property on the ColumnMangerCell.

    e.g. :

    Image image = new Bitmap( @”D:\Logo.png” );

    Image imageResized = new Bitmap( image, new Size( 15, 15 ) );

    foreach( ColumnManagerCell cell in columnManagerRow1.Cells )

    {

      cell.BackgroundImage = new Bitmap( imageResized );

      cell.BackgroundImageAlignment = ContentAlignment.MiddleLeft;

    }

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

    User (Old forums)
    Member
    Post count: 23064

    Thanks for the quick reply, I am able to add the image but
    will it be possible to capture a click event on the image only, I have a
    scenario where I want to open a window when use clicks on the image present in
    the column header.

    Thanks

    – Amit  

    Imported from legacy forums. Posted by Amit (had 635 views)

    User (Old forums)
    Member
    Post count: 23064

    No, the click will apply to the whole cell.

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

    User (Old forums)
    Member
    Post count: 23064

    Thank You

    Imported from legacy forums. Posted by Amit (had 1534 views)

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