TreeList Binding issues

9 posts, 0 answers
  1. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 16 Oct 2013 Link to this post


    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.
  2. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 16 Oct 2013 Link to this post

    Hi Team,

    Can anybody reply on this.

    Regards,
    Sandeep
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 21 Oct 2013 Link to this post

    Hi Team,

    Please help me in this issues.

    Regards,
    Sandy
  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 21 Oct 2013 Link to this post

    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.
  6. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 23 Oct 2013 Link to this post

    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
  7. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 25 Oct 2013 Link to this post

    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.
  8. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 28 Oct 2013 Link to this post

    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
  9. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 29 Oct 2013 Link to this post


    Hi Konstantin,

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

    Regards,
    Sandeep.
  10. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 31 Oct 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017