Disable the drill down feature in the datagrid
Dear all,
I would like to know whether I can disable the "Plus" or "Minus" button in
the master-detail relationship in the datagrid? i.e. I have add a relation
between master and detail,
and when I am displaying the master table records, the grid has a "plus" or
"minus" at front,
can I disable it?
Simon
Although I may be possible to suppress the display of the +/-, you can simply bind the grid to a DataTable, rather than the DataSet? That way, you'd only see that particular table?
For example, if you're currently using:
DataGrid1.DataSource = myDataSet
use this code instead:
DataGrid1.DataSource = myDataSet.Tables(0)
You can index into the Tables collection either by numeric index, or with the name of the table, if you supplied one when you filled the dataset.
First of all, thx for your reply.
But in my case, I have added a relation between the master and detail table.
and I want to show the both the master and detail in the screen.
I have set the master datagrid's datasource to master table, and detail datagrid's datasource to the relation.
dgdMaster.DataSource = ds;
dgdMaster.DataMember = ds["Master"];
dgdDetail.DataSource = ds;
dgdDetail.DataMember = "ds["MDRelation"];
I have tried, whether display or do not display the detail's datagrid, if I have a relation master and detail table, it will show the drill down button(plus or minus ).
Can you show my how to suppress the drill down button?