How to make table inside datagrid resize?

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
 
G

Guest

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
 
A

Alex Passos

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
 
G

Guest

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
 
A

Alex Passos

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top