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
215
Programatically reset relations in WebHierarchicalDataSource
posted

I have a WebHierarchicalDataSource created and set relations visually on aspx page.

I need to filter the undelying dat ato display in the Ultrawebtree. I can change the SqlDataSource.SelectCommand for both data sources (just two levels in the tree) and it filters fine. The only problem is that each parent node appears as many times as there is a max och child nodes. My guess is that the Relationship in WebHierarchicalDataSource  needs to be reset.

What is the proper syntax to do that? Or is it a different problem?

Here is the snip of the code I am using:

 

 

SqlDataSource2.SelectCommand =

 

"SELECT Profile, ProjectName .....

 

 

SqlDataSource1.SelectCommand = "SELECT tClients.ClientID, tClients.ClientName FROM ...

WebHierarchicalDataSource1.DataBind()

UltraWebTree1.DataBind()

UltraWebTree1.ExpandAll()

 

Thanks

 

Parents
  • 3147
    posted

    Hi,

    The information you have provided is insufficient for me to solve the issue.

    bilko73 said:

    I have a WebHierarchicalDataSource created and set relations visually on aspx page.

    How exactly you are doing that?

    bilko73 said:
    The only problem is that each parent node appears as many times as there is a max och child nodes.

    I don't understand that, can you please explain in more detail?

    bilko73 said:
    My guess is that the Relationship in WebHierarchicalDataSource  needs to be reset.

     

     

     

    WHDS Relation itself can not be reset, maybe you are trying to clear the relations collection? If so you can use the Clear() method.

    If that doesn't help please provide more info and the complete source code (or sample project).

Reply Children