How to disable children in a datagrid

bloukewer

Well-known member
Joined
Jul 2, 2004
Messages
88
Programming Experience
3-5
I'm wondering if there's a way to prevent a datagrid from displaying children-records (the little plus-boxes on the vertical headers).

I created two datasets with a master-detail relationship. My problem is this...
I only want to display the master-table in the datagrid, the child-table's fields is bound to simple-controls (like textboxes). How do I prevent the datagrid from displaying the little "+"-boxes on the side, without breaking up the relationship. (No pun intended)

I did specify the collection of columns to display, but those frkn plusses!

An example would be much appreciated
 
do like this
VB.NET:
 dim cn as new sqlconnection("....")
 dim ds as new dataset()
 ds.tables.add(new datatable("sampletable"))
 dim da as new sqldataadapter("select * from mastertable",cn)
 da.fill(ds.tables(0))
 datagrid1.datasource = ds.tables(0)
 
Changing the "AllowNavigation" property of the dataGrid to False will remove the "+"s.

You can also set the "RowHeadersVisible" property to False which will remove the column in which the "+"s are shown (the RowHeader).
 
Back
Top