How to make table inside datagrid resize?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have form with datagrid control. I bind dataview object to datasource
property of the datagrid to populate it with data.

My question is how can I make columns and rows of the table inside datagrid
resize when form itself resizes. I set anchor property properly so datagrid
control itself DOES resize when I resize form, but table inside datagrid
control doesn't.

Can anyone give me a hint?

Thanks
 
Thank you for your tip.

Do you know how to hide the Datagird's Row Indicator (Triangle) which gets
displayed on the Row header, without hiding whole row header?

Thanks
 
Try DataGrid.RowHeadersVisible = false;

Alex

Steve said:
Thank you for your tip.

Do you know how to hide the Datagird's Row Indicator (Triangle) which gets
displayed on the Row header, without hiding whole row header?

Thanks
 
No, this won't work.
Setting this property to false will completely hide row headers.
I need to keep row headers but hide only Datagird's Row Indicator (Triangle).
Can you advise?

Thanks
 
I don't know that there is a way to do that by looking up the Docs. This
might be a really long shot but my next approach would be to intercept the
OnPaint event and do the following:

call the base to paint the control
determine if the selected cell is in the viewable area (docs for this exist
on MSDN).
if the cell is on the viewable area, get the row/col from current cell
using the cell location, find out where the rectangle that contains the
triangle (row indicator) is located (we know its in the same row and before
the first column).
Draw3drect probably can redraw over the indicator with the same color of the
grey cell.

Makes sense?

Yep, its complicated and will be time consuming.
 
Back
Top