WinForms - DataGrid - How to remove "plus" icon from RowHeader

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

Guest

Hi guys!

I've done a relation between two tables I have in my DataSet.
To show those two tables I have two DataGrids and I don't want to see that
"plus" signal on the parent's table RowHeader. I've tried to turn false the
RowHeaderVisible property but it doesn't work.

I'm doing that to bind the grids:
DataGridParent.SetDataBinding(DataSet.Tables("Table1").DefaultView,
String.Empty)
DataGridChild.SetDataBinding(DataSet.Tables("Table2").DefaultView,
String.Empty)

Do you know to handle this issue?

Thanks
 
Be sure to bind the datagrid to a particular table, so that the plus sign
disappears.

-Alt
 
Hi,

Andreiwid said:
Hi guys!

I've done a relation between two tables I have in my DataSet.
To show those two tables I have two DataGrids and I don't want to see that
"plus" signal on the parent's table RowHeader. I've tried to turn false
the
RowHeaderVisible property but it doesn't work.

Set DataGridParent.AllowNavigation to false.

--
If you have created a DataRelation between the DataTables, then you can bind
the child DataGrid to a relation of the parent DataTable (or even DataView),
eg:

DataGridParent.SetDataBinding( DataSet.Tables("Table1"), "" )
DataGridChild.SetDataBinding( DataSet.Tables("Table1"),
"Table1ToTable2Relation" )

This way, the child grid will automatically get filtered depending on the
selected parent row.

HTH,
Greetings
 
Andrewid,

I am not completly sure which plus, however if the answers from the others
is not the answer, than it can be before the binding
\\\
DataSet.Tables("Table1").DefaultView.addnew = false
///
Using the datasource is much easier by the way than the setdatabinding
\\\
DataGridParent.Datasource = Dataset.Tables("Table1")
///

I hope this helps,

Cor
 
Thanks for everybody.

Bart gave the tip which I was looking for: Set
DataGridParent.AllowNavigation to false.
 
Back
Top