This is a migrated thread and some comments may be shown as answers.

TreeList Binding issues

8 Answers 86 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 16 Oct 2013, 11:00 AM

Hi Team,

I am using Treelist with paging and implemented AllowLoadOnDemand. I am facing below issues.

I wanted to expand all items, which I tried using ExpandAllItems() at page level but could not achieve it.

And I am using TreeListSelectColumn for checkbox, whenever I am selecting header checkbox it selects treelist items but
header checkbox become unselected.

And if I select checkbox for "11 22" under node performancerisk100 , and expand anyother node it displayed as selected, refer to screen shot attached.

Can anybody help on this.
 
Regards,
Sandeep.

8 Answers, 1 is accepted

Sort by
0
Sandeep
Top achievements
Rank 1
answered on 17 Oct 2013, 04:25 AM
Hi Team,

Can anybody reply on this.

Regards,
Sandeep
0
Sandeep
Top achievements
Rank 1
answered on 21 Oct 2013, 06:11 AM
Hi Team,

Please help me in this issues.

Regards,
Sandy
0
Konstantin Dikov
Telerik team
answered on 21 Oct 2013, 06:40 AM
Hi Sandeep,

It will be hard to determine the reasons behind the issues you are experiencing from the provided information and screenshot. 

Please refer to the attached sample page with similar to yours scenario with select functionality and "ExpandAllItems" method called on initial page load, both working as expected.

Moreover, you could have a look at the following online demos:

In order for us to be of any further assistance, please open a regular support ticket with sample, runnable project attached that replicates the issues you are observing, so we could inspect the issue locally.

 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sandeep
Top achievements
Rank 1
answered on 23 Oct 2013, 05:55 AM
Hi,

I am using the below code

 <telerik:RadTreeList ID="RadTreeList1" AllowLoadOnDemand="true" AllowSorting="true"
            AllowPaging="true" PageSize="5" AutoGenerateColumns="false" OnChildItemsDataBind="RadTreeList1_ChildItemsDataBind"
            OnNeedDataSource="RadTreeList1_NeedDataSource" DataKeyNames="EmployeeID" ParentDataKeyNames="ReportsTo"
            ClientDataKeyNames="EmployeeID" AllowMultiItemSelection="true" runat="server">
            <Columns>
                <telerik:TreeListSelectColumn HeaderStyle-Width="40px" UniqueName="chkBox" HeaderText="">
                </telerik:TreeListSelectColumn>
                <telerik:TreeListBoundColumn DataField="EmployeeID" HeaderText="EmployeeID" Visible="true"
                    HeaderStyle-Width="50px" UniqueName="EmployeeID" />
                <telerik:TreeListBoundColumn DataField="FirstName" HeaderText="FirstName" Visible="true"
                    UniqueName="FirstName" />
            </Columns>
            <ClientSettings>
                <Selecting AllowItemSelection="false" AllowToggleSelection="true"></Selecting>
            </ClientSettings>
        </telerik:RadTreeList>



protected void RadTreeList1_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
    {
        RadTreeList1.DataSource = GetDataTable("Select EmployeeID, FirstName, ReportsTo from Employees where ReportsTo IS Null", null);
    }

    protected void RadTreeList1_ChildItemsDataBind(object sender, TreeListChildItemsDataBindEventArgs e)
    {
        int id = Convert.ToInt32(e.ParentDataKeyValues["EmployeeID"].ToString());
        SqlParameter param = new SqlParameter();
        param.ParameterName = "@EmployeeID";
        param.Value = id;
        e.ChildItemsDataSource = GetDataTable("Select EmployeeID, FirstName, ReportsTo from Employees where ReportsTo = @EmployeeID", param);
    }

    private DataTable GetDataTable(string query, SqlParameter param)
    {
        SqlConnection conn = new SqlConnection(ConnString);
        SqlDataAdapter adapter = new SqlDataAdapter();
        SqlCommand command = new SqlCommand(query, conn);

        if (param != null)
        {
            command.Parameters.Add(param);
        }
        adapter.SelectCommand = command;
        DataTable myDataTable = new DataTable();

        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }

        return myDataTable;

    }

Regards,
Sandy
0
Konstantin Dikov
Telerik team
answered on 25 Oct 2013, 02:33 PM
Hello Sandeep,

I have tested your settings and I still not able to replicate the issue and observe any problems with ExpandAllItems() method on initial page load.

Could you please test the attached sample page and see how it works for you.

If you continue to face that issue, and if you are using old RadControls version, please try to update to our latest and see if the issue is still present.

Looking forward to your reply.

 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sandeep
Top achievements
Rank 1
answered on 28 Oct 2013, 08:37 AM
Hi Konstantin,

I have seen the sample code sent by you, thanks for that. But, what if I have to use AllowloadonDemand= true, ExpandAllitems and AllowRecursiveSelection=true.

My requirement is to use above three features of treelist.

Can you please help me on this. It would be great if you can send me the sample code.

Regards,
Sandeep
0
Sandeep
Top achievements
Rank 1
answered on 29 Oct 2013, 06:16 AM

Hi Konstantin,

Any suggestion, if I want to use all the three features in treelist.

Regards,
Sandeep.
0
Konstantin Dikov
Telerik team
answered on 31 Oct 2013, 07:20 AM
Hello Sandeep,

I have tested this again and this time I was able to replicate the issue with "AllowLoadOnDemand" and "AllowRecursiveSelection" set to "true".

I will log this into our system so our developers team could investigate it further to determine if this is a bug or limitation. 

Nevertheless, I have updated your Telerik Points for reporting this issue.

Please excuse us for any inconvenience caused by this.

 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeList
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Sandeep
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or