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

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
 
S

S.M. Altaf [MVP]

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

-Alt
 
B

Bart Mermuys

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
 
C

Cor Ligthert [MVP]

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
 
G

Guest

Thanks for everybody.

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

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