Skip to main content

GridiHeader Resize

Comments

4 comments

  • Dapfor Team

    Hello Sasee,

    The Column class has the Adjust() method. To fit a column to its best width use the following:

     

    Column column = grid.Headers[0]["yourId"];
    column.Adjust(true, true);

     

    Best regards,

    Dapfor

     

    0
  • su myat

    Hi Dapfor Team,

    My grid  has dynamic created columns and I'm using "column.Adjust" method to get auto adjust column width by grid header.

    My problems is if the column value is longer than the column header it cannot showing completely. like showing in figure 1:

     

    figure 1 : actual value for Order Price column is 123456.1

    I want to get the column display to auto adjust according to data value  so that the user can know the data is incomplete

    or another way to change the display to some mask data like in excel.

    Could you help me advice ? Many thanks in advance .

    Have a good day !!

     

    With Regards

    Su Myat

    0
  • su myat

    I just attached the picture.

    Figure 1  and excel mask data ###.

    Thanks

    With Regards

    Su Myat




    order price 1.JPG
    excel mask data.JPG
    0
  • Dapfor Team

    Hello,

    You can alter default flags to draw text in cells. The best and easiest way - is to add ellipsis characters, if the text is out of the cell.

     

    grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
    {
        if(e.Cell.Column != null)
        {
            e.TextSettings.Trimming = StringTrimming.EllipsisCharacter;    
        }
    };

     

    Best regards,

    Dapfor

     

     

    0

Please sign in to leave a comment.

Powered by Zendesk