We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

"Float" column

Hi, How can I specify a column to be "float" width. i.e. it should occupy the remaining spce of the grid after other columns (of fixed) width''s have taken theirs..? Thanks.

3 Replies

AD Administrator Syncfusion Team October 5, 2005 04:49 PM UTC

You can handle the grid.Model.QueryColWidth event. If the e.Index points to your floating column, you can set e.Size to be the size that you want the column to be. If floatCol is your float colindex, you can try code like:
if(e.Index == floatCol)
{
    e.Size = grid.ClientSize.Width - grid.Model.ColsWidths.GetTotal(0, floatCol - 1) - grid.Model.ColWidths.GetTotal(floatCol + 1, grid.Model.ColCount);
    e.Handled = true;
}
Here is a link to a KB that gives a helper class that offers a more general solution but is a little more involved. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=304


AD Administrator Syncfusion Team October 5, 2005 06:29 PM UTC

You might want to add this as an enhancement.


AD Administrator Syncfusion Team October 5, 2005 06:30 PM UTC

I mean have a flag, like: m_grid.ColWidths[i].IsFloat = true;

Loader.
Live Chat Icon For mobile
Up arrow icon