Page 1 of 1

Don't know, how to handle two DataLinks

Posted: Tue 06 Jan 2009 11:37
by Zero-G.
Hey
I use VB.NET 2008 abd your latest controls of dotConnect v 5.0.16.0

So, I have the following situation in my program:
I have a Dataset with a table called order.
I created a UserControl and added two Grid's (from Janus - not MS).
One Grid is a Overview. - The second Grid should handle the details of the order.
So, I added a Datalink and set this DataSource to the DataSet itself.
Then I added a second DataLink, which DataSource is the first DataLink.
Now I coded the following in the Click Event of the overview's Grid:

Code: Select all

If dLinkAuftragDetail.DataSource Is Nothing Then
            Me.dLinkAuftragDetail.DataSource = Me.dLinkOrder
        End If
        Me.dLinkAuftragDetail.Filter = "ID=" & Me.grdÜbersicht.GetValue("id")
        Me.grdAuftrag.AutoSizeColumns()
So, the details are displayed correct, but the overview is also reduced the selected entry. - All other orders are not displayed anymore.
How can I change this behaivor? - So that the overview still holds all orders?
Hope you understand my problem

THX

Posted: Thu 08 Jan 2009 09:51
by Shalex
Please try setting the SeparateEditing property of your dLinkAuftragDetail object to true. You can do this either in design time or in run-time.

Posted: Thu 08 Jan 2009 11:05
by Zero-G.
Hey

Thanks, works fine!
I have set the overview's Seperate Editing to true, not the Child one...

Is there any informaiton about the seperate Editing?

THX

Posted: Thu 08 Jan 2009 12:43
by Shalex
The SeparateEditing property indicates the source of data that this control will use to get its items.
By default, DataLink uses the same DataView that is used by data source that is referenced by DataLink. This affects sorting, filtering of data in the DataLink object.
If you set the SeparateEditing property to true, DataLink creates its own DataView object that is handled by filtering.

For more information, please refer to the Creating and Using DataViews section of MSDN.