AutofitColumns width in Desktop grid

Hi

I am using desktop grid. I want to autoset the width of each column of grid as per the width of maximum value cell of column.

Kindly give a quick reply.

Hi,

You can do it with both ways i.e.., using WYSIWYG manner and using the GridDesktop's APIs.

1). On the grid, you can put the mouse cursor on your desired column header until the cursor become the handle like '+', now click the mouse button, it will auto-fit the column just like MS Excel.

2). You can do it programmatically too.

e.g..,

[C#]

//Auto-Fit the first column in the first worksheet.

GridDesktop1.Worksheets[0].AutoFitColumn(0);

[VB]

'Auto-Fit the first column in the first worksheet.

GridDesktop1.Worksheets(0).AutoFitColumn(0)

Thank you.

Thanks a lot Amjad. :slight_smile: