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
385
UltraWebTree Manual Vs. Auto & Ajax
posted

Hello,

I've just started using the UltraWebTree and am having difficulties. However, I'd like to ask about how the tree works with Ajax. From looking at the samples, I can see that you can use manual and automatic modes. But, what is the significance of this? From what I can see, the manual mode requires the DemandLoad event to be populated. But this begs the question: what has this got to do with Ajax? If the tree is simply populating based on an ASP event, isn't this just straight ASP, and not Ajax?

Looking at the automatic mode code (from the samples page), I can't really see how it is working. It shows some setup code, but it doesn't provide any web methods or JavaScript code to explain how to populate the tree with Ajax.

This is the Page_Load code.

            WebPanel2.Visible = WebSamplesCS.Config.ShowDescription;

            // When the LoadOnDemand property is set to Automatic,
            // the database must be bound on each postback.


            // Get Database connection path for nwind.mdb
            oleDbConnection1.ConnectionString = WebSamplesCS.Config.NorthwindMDBConnString;

            customersAdapter.Fill(dataSet11, "Customers");
            ordersAdapter.Fill(dataSet11, "Orders");
            orderDetailsAdapter.Fill(dataSet11, "Order Details");

            try
            {
                dataSet11.Relations.Add("CustOrders",
                    dataSet11.Tables["Customers"].Columns["CustomerID"],
                    dataSet11.Tables["Orders"].Columns["CustomerID"]);
            }
            catch (System.Exception x)
            {
                string s = x.Message;
                Label1.Text = x.Message;
            }

            try
            {
                dataSet11.Relations.Add("OrderDetails",
                    dataSet11.Tables["Orders"].Columns["OrderID"],
                    dataSet11.Tables["Order Details"].Columns["OrderID"]);
            }
            catch (System.Exception x)
            {
                Label1.Text = x.Message;
            }
            this.UltraWebTree1.DataSource = dataSet11;
            this.UltraWebTree1.Levels[0].RelationName = "CustOrders";
            this.UltraWebTree1.Levels[0].ColumnName = "CompanyName";
            this.UltraWebTree1.Levels[1].RelationName = "OrderDetails";
            this.UltraWebTree1.Levels[1].ColumnName = "OrderId";
            this.UltraWebTree1.Levels[2].ColumnName = "ProductId";
            this.UltraWebTree1.DataMember = "Customers";
            this.UltraWebTree1.DataBind();
 

 This is great if your dataset is relational data tables. But, we don't use anything like that. We have our own object model.

So the question is, how can we get the control to use proper Ajax with our object model?

 

Parents
  • 385
    posted

    Come to think of it, the same question goes for the UltraWebGrid. I looked at this code:

    http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm 

    But from what I can see, you have to specify the way the data works using a series of data tables and relations etc. That just doesn't fit our model at all.

    The kind of model we need is one where you initialise the Tree/Grid, and then when the control asks for data, a WebMethod is provided to serve up the data to the control. That way there are 0 postbacks and you don't have to load all the data on the server side on the initialisation of the control.

    Am I barking up the wrong tree here? Is there something I'm missing?

Reply Children