configuration. I dragged the parent table to an empty form from the project
datasources window. This created a datagridview, binding source, and binding
navigator ( I deleted the navigator). I then clicked on the + sign on the
from the datasource window to the form. This setup a datagridview for the
the relationship name. My datasource is a remote dataset object contained in
row in the child datagridview throws the exception I noted.
childBindingSource.AllowNew property. I test for parentTable.Rows.Count > 0
OnFormLoad. If the count is 0, I set AllowNew = False, else True. I then
cellParsing event in the parent datagridview. This solution seems to be
Thanks.
"Linda Liu [MSFT]" wrote:
> Hi John,
>
> I am sorry that I may not understand your problem fully.
>
> > If the user clicks on an empty row's cell in the child datagridview
> without there being an owning parent datarow, the above exception is
> thrown, which makes sense.
>
> Could you tell me what you mean in the above sentence?
>
> I have performed a test representing a parent and a child table in two
> DataGridViews. When I click on the new row's cell in the child
> DataGridView, nothing happens.
>
> Below is the steps of my test.
>
> 1. Set up a Windows application.
>
> 2. Create a DataSet and add two DataTable in it(e.g ParentTable and
> ChildTable). Create a relation between the two DataTables in DataSet
> designer(e.g Parent_Child).
>
> 3. Drag&drop two DataGridViews and two BindingSource onto the form. Add an
> instance of DataSet to the form.(e.g parentDataGridView, childDataGridView,
> parentBinding, childBinding, dataset1)
>
> 4. Set parentBinding.DataSource = dataset1,
> parentBinding.DataMember = "ParentTable",
> childBinding.DataSource = parentBinding,
> childBinding.DataMember = "Parent_Child",
> parentDataGridView.DataSource = parentBinding,
> childDataGridView.DataSource = childBinding
>
> When the program is running, the parentDataGridView represents all the data
> in the parent table and the childDataGridView represents the corresponding
> data in the child table.
>
> Are the steps of my test the same to yours? If not, you may explain in
> detail or provide the sample code.
>
> I look forward to your reply.
>
>
> Sincerely,
> Linda Liu
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
>
http://msdn.microsoft.com/subscriptions/support/default.aspx. > ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>