Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript event from C# control inside custom template
    primarykey
    data
    text
    <p>I have a RadTreeNode styled with a custom template that has inside controls.</p> <p>Custom template defined as </p> <pre><code>class AdminFunctionsPhenoTreeTemplate : ITemplate { public void InstantiateIn(Control container) { container.Controls.Add(new LiteralControl("&lt;table class=\"mystyle\"&gt;&lt;tr&gt;&lt;td&gt;")); Label label1 = new Label { ID = "ItemLabel", Text = "Text" }; label1.DataBinding += label1_DataBinding; container.Controls.Add(label1); container.Controls.Add(new LiteralControl("&lt;/td&gt;&lt;td&gt;")); // rights RadioButtonList rbRights = new RadioButtonList { ID = "rbRights", RepeatDirection = RepeatDirection.Horizontal }; rbRights.Items.Add(new ListItem("r/o")); rbRights.Items.Add(new ListItem("r/w")); rbRights.Items.Add(new ListItem("r/w/meta")); rbRights.Items.Add(new ListItem("FORBID")); rbRights.SelectedIndex = 0; container.Controls.Add(rbRights); CheckBox cb = new CheckBox { ID = "grantRights", Text = "Grant" }; container.Controls.Add(cb); container.Controls.Add(new LiteralControl("&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;")); // global } private static void label1_DataBinding(object sender, EventArgs e) { Label target = (Label)sender; RadTreeNode node = (RadTreeNode)target.BindingContainer; string nodeText = (string)DataBinder.Eval(node, "Text"); target.Text = nodeText; } } } </code></pre> <p>And when I create a RadTreeNode, this template is assigned to node, something like this</p> <pre><code> rtn = new RadTreeNode(sn.NAME + " [" + sn.SECTION_ID + "]", rtnvalue) { NodeTemplate = new AdminFunctionsPhenoTreeTemplate(), ExpandMode = TreeNodeExpandMode.ServerSideCallBack }; </code></pre> <p>Now, when user clicks on one of radio buttons or on the checkbox, I want to trigger a client-side, Javascript event as I need to store what node was clicked. Standard "OnClientNodeClicked" JS event of RadTreeView is available, but it is not triggered if I click on these controls (if I just click on node name, it works).</p> <p>So how I can trigger an event and collect Node ID when user alters template controls?</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload