How to suppress new-data row in datagrid with parent-child data

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi All,

I have a form set up with a data source which has a parent-child
relationship. The parent table is bound to a combo box, and the child
to a datagrid. I want the datagrid to show the child records for the
parent selected in the combo. I know how to do this, and it all works
fine. But I cannot suppress the datagrid row with the * against it,
where a new row can be entered.

From what I have read, the way to do this is to make the data source
for the datagrid a DataView, with the AllowAddNew property set False.
That's fine, but as soon as I do that I lose the parent-child behaviour
- catch 22!

Is there a way to suppress the new-data row in the grid, AND preserve
the parent-child behaviour I need? It sure as hell isn't intuitive!

.



Relevant Pages

  • multiple parents and custom member
    ... I obviously can not use the parent-child dimension straight away because analysis server requires the children to be unique. ... To circumvent this problem I created a pseudo key and a custom member for each repeating child as shown below. ...
    (microsoft.public.sqlserver.olap)
  • Append child data with autoincrement field?
    ... When appending data from parent-child tables I always loose the data of the ... Due to the autoincrement field in the parent table I can only append data ... without the 'id' field and the link to the child tables get broken. ... How can I append parent-child tables without braking the link? ...
    (microsoft.public.fox.programmer.exchange)
  • DataGrid on DataViewManager, no AllowNew?
    ... I'm using a DataViewManager to sort the children of parent-child ... The DataViewManager and DataGrid work ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Nested datagrid?
    ... Were you looking for something to do parent-child tables? ... want to look at HierarGrid by Denis Bauer: ... > Can a datagrid be nested inside of a datareader? ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)