K
Kristin
How do I find out the size (specifically width) of a listbox's (specifically datagrid) "viewport" where the "viewport" does not contain borders (Fixed3D and otherwise), scrollbars, etc. ?
Microsoft defines a "viewport" in help text for the "DataGrid.VisibleColumnCount" property as so: "The viewport is the rectangular area through which the grid is visible." Well that's exactly what I need but where do I get it and it's attributes?
I'm asking because I'm writing a method which fills the width of a DataGrid with the columns defined in the active TableStyle. The problem is that I can't get the width of the datagrid which does not include the border, scrollbars, etc.
I've tried the following and they all refer to the width of the ClientRectangle which inclues scrollbars, borders, etc.
dataGrid.Width
dataGrid.ClientRectangle.Width
dataGrid.Bounds.Width
dataGrid.DisplayRectangle.Width
dataGrid.Size.Width
If I allocate column widths such that the total of all column widths is equal to, say, dataGrid.Width, I still get a horizontal scrollbar. The difference between dataGrid.Width and this total of all column widths is the width of say a 3D border, vertical scrollbar, etc.
Any suggestions?
Kristin
Kristin Barker
Principal Software Engineer
Email: (e-mail address removed)
http://www.natureserve.org
Microsoft defines a "viewport" in help text for the "DataGrid.VisibleColumnCount" property as so: "The viewport is the rectangular area through which the grid is visible." Well that's exactly what I need but where do I get it and it's attributes?
I'm asking because I'm writing a method which fills the width of a DataGrid with the columns defined in the active TableStyle. The problem is that I can't get the width of the datagrid which does not include the border, scrollbars, etc.
I've tried the following and they all refer to the width of the ClientRectangle which inclues scrollbars, borders, etc.
dataGrid.Width
dataGrid.ClientRectangle.Width
dataGrid.Bounds.Width
dataGrid.DisplayRectangle.Width
dataGrid.Size.Width
If I allocate column widths such that the total of all column widths is equal to, say, dataGrid.Width, I still get a horizontal scrollbar. The difference between dataGrid.Width and this total of all column widths is the width of say a 3D border, vertical scrollbar, etc.
Any suggestions?
Kristin
Kristin Barker
Principal Software Engineer
Email: (e-mail address removed)
http://www.natureserve.org