Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
Load on Demand Issue
posted
Normal 0 21 false false false DE X-NONE X-NONE MicrosoftInternetExplorer4

Hallo,  this is my first post and sorry for my english (google-translate for ever)..

There are a problem with Load on Demand wenn i built it on runtime.

I got an 2-level WebHierarchicalDataGrid, 2 SqlDataSources and WebHierarchicalDataSource with default properties.

I make binding at runtime, in WebHierarchicalDataGrid_Init Funktion.

If i set InitialDataBindDepth="-1" it works properly (no Load on Demand).

If i set InitialDataBindDepth="0", after expanding of ParentRow is result of ChildDataView duplicated.

 


Here is my Code:

Protected Sub hdgAgentWork_Init(sender As Object, e As EventArgs) Handles hdgAgentWork.Init

 ' Create the view

Dim viewOfDay As New Infragistics.Web.UI.DataSourceControls.DataView()

Dim viewOfWeek As New Infragistics.Web.UI.DataSourceControls.DataView()

 

' Set the required properties

viewOfDay.ID = "dsAgentWorkByDay_View"

viewOfDay.DataSourceID = Me.dsAgentWorkByDay.ID

 

viewOfWeek.ID = "dsAgentWorkByWeek_View"

viewOfWeek.DataSourceID = Me.dsAgentWorkByWeek.ID

 

' add Views to HierarchicalDataSource

hdsAgentWork.DataViews.Add(viewOfDay)

hdsAgentWork.DataViews.Add(viewOfWeek)

 

 ' create Relations

Dim dr As New Infragistics.Web.UI.DataSourceControls.DataRelation()

dr.ParentDataViewID = viewOfWeek.ID

dr.ParentColumns = New String() {"AW_AGENTID"}

dr.ChildDataViewID = viewOfDay.ID

dr.ChildColumns = New String() {"AW_AGENTID"}

Me.hdsAgentWork.DataRelations.Add(dr)

 

hdgAgentWork.DataKeyFields = "AW_AGENTID"

hdgAgentWork.DataSourceID = hdsAgentWork.ID

 

End Sub

 

It's wrong to do that in WebHierarchicalDataGrid_Init Funktion ?