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

RadTreeView nodeclick problem

3 Answers 187 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Neda
Top achievements
Rank 1
Neda asked on 26 Oct 2011, 08:45 AM
hi

I am using radtreeview with the following properties and settings but when i click on node "onnodeclick" event dosnot work.
the second problem is that the + in right of node does not work at all(expand), and also when i debug it doesn't go to nodeclick event.

     <telerik:RadTreeView ID="TreePicGroup" runat="server" DataFieldID="ID" DataFieldParentID="ParentID"
                            DataTextField="Title" CheckBoxes="true" OnNodeClick="TreePicGroup_NodeClick" OnNodeDrop="treeRole_NodeDrop"
                            EnableDragAndDrop="True" EnableEmbeddedSkins="True" Skin="Telerik"
                            dir="rtl" RegisterWithScriptManager="False" >
                        </telerik:RadTreeView>
-------------------------------------------------------------------------------------------------------------------------------------------------
C# Code

  
    protected void TreePicGroup_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        pnlMSG.Visible = false;
        pnlSetting.Visible = true;

        lblSubMenu.Text = e.Node.Text;

        if (e.Node.Text != "ريشه" && HidNewGroup.Value != "New")
        {

            DataTable dtGroup;

            CMS_PictureGallary ObjPicGroup = new CMS_PictureGallary();

            dtGroup = ObjPicGroup.GetGroup(Convert.ToInt32(cmbLibrary.SelectedValue), Convert.ToInt64(e.Node.Value));
            txtTitle.Text = dtGroup.Rows[0]["Title"].ToString();
            txtDes.Text = dtGroup.Rows[0]["Des"].ToString();
            txtDate.Value = ShamsiDate.get(dtGroup.Rows[0]["Created"].ToString(), 1);
            chkShowPic.Checked = Convert.ToBoolean(dtGroup.Rows[0]["PicPanel"]);
            if (dtGroup.Rows[0]["Link"].ToString().StartsWith("?PageID"))
            {
                CboLink.SelectedValue = "1";
                txtLinkID.Text = dtGroup.Rows[0]["Link"].ToString();
                TrLink.Visible = true;
            }
            if (e.Node.ParentNode == null)
                ChkReport.Enabled = false;
            else
            {
                ChkReport.Enabled = true;
                int Report = ObjPicGroup.Search_ReportGroup(Convert.ToInt32(cmbLibrary.SelectedValue), (dtGroup.Rows[0]["ParentID"]).ToString());
                if (Convert.ToInt32(e.Node.Value) == Report)
                    ChkReport.Checked = true;
                else
                    ChkReport.Checked = false;
            }
            //set Visible
            cboDisplay.SelectedValue = Convert.ToInt32(dtGroup.Rows[0]["checked_out"]).ToString();
            ImgPic.ImageUrl = "~/uploads/" + dtGroup.Rows[0]["BasesID"].ToString() + "/PictureGallary/Group/" + e.Node.Value.ToString() + ".jpg";


            BtnReg.Text = "ويرايش";
            pnlGroupName.Visible = true;

        }
        else
        {
            pnlGroupName.Visible = false;
            if (HidNewGroup.Value == "New")
            {
                txtTitle.Text = "";
                txtDate.Value = ShamsiDate.get(DateTime.Now.ToString(), 1);
            }
            else
                pnlSetting.Visible = false;
        }
    }
----------------------------------

Thanks NeDa

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Oct 2011, 08:28 AM
Hello Neda,

I have tried to reproduce the same but no avail. After inspecting your code I found out that the NodeClick event name you entered in CS page is different from ASPX.

Thanks,
Princy.
0
Neda
Top achievements
Rank 1
answered on 27 Oct 2011, 09:25 AM
Hi Princy
 i fixed that problem but the main problem  still exists...


Thanks Neda
0
Plamen
Telerik team
answered on 28 Oct 2011, 03:53 PM
Hi Neda,

Please make sure that by default NodeClick event should not fire when you click on the "plus" but only on the node itself. When you click the "plus" NodeExpand is fired only if the Node ExpandMode property must be set to ServerSide, ServerSideCallback or WebService.

Greetings,
Plamen Zdravkov
the Telerik team
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 their blog feed now
Tags
TreeView
Asked by
Neda
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Neda
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or