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

With of all columns _ including those not in view

I have a DataBoundGrid control on a panel. When it is populated with data I want the panel to be sized to display just the first two columns. I have a button which, when pressed, I want to expand the panel so that all columns are visible. I don''t want to hide columns (ie the user can still scroll to the other columns when only the first two are visible). I can''t work out how to find the right size parameters to pass to the Panel.ClientSize property. (I don''t need to change the height, it is just the width) Thanks

1 Reply

AD Administrator Syncfusion Team January 14, 2005 03:24 PM UTC

To get the width of the first 2 column and the header column, try code like: int width = grid.Model.ColWidths.GetTotal(0,2); To get the width of all columns, try code like: int width = grid.Model.ColWidths.GetTotal(0,grid.Model.ColCount);

Live Chat Icon For mobile
Up arrow icon