I have created a custom template that I am using on level 1 nodes.
It renders perfectly inside each node and I have put controls inside the template. Every control except the checkbox cannot be edited.
For example. I want a label and a dropdownlist inside my template. But I cannot make the dropdownlist function, it renders but the list never appears when pressing the button for the drop down list
Hello,
I am wondering did you had the chance to check the CodeSample attached to my first response. It could be helpful for you, even in C# code.
<bump> any thoughts?
First, thanks for the repy, lvaylo.
Here is the asp.net page:
<ig:WebDataTree ID="wdtProcedure" runat="server" CheckBoxMode="TriState"> <Templates> <ig:ItemTemplate ID="wdtProcedureTemplate1" runat="server" TemplateID="Template1"> <Template> <asp:DropDownList ID="ddlMultiplier" runat="server"> <asp:ListItem Text="1" Value="1"></asp:ListItem> <asp:ListItem Text="2" Value="2"></asp:ListItem> <asp:ListItem Text="3" Value="3"></asp:ListItem> </asp:DropDownList> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse !important; border-spacing: 0px"> <tr> <td> </td> <td> <asp:TextBox ID="txtMultiplier" runat="server" Text="1"></asp:TextBox> </td> <td> <asp:CheckBox ID="chkProcedure" runat="server" /> </td> <td> <asp:Label ID="lblProcedureName" runat="server" Text="Label"></asp:Label> </td> <td> <input id="Text1" type="text" /> </td> </tr> </table> </Template> </ig:ItemTemplate> </Templates> <DataBindings> <ig:DataTreeNodeBinding DataMember="procedure_group" KeyField="procedure_group_id" TextField="procedure_group_desc" ValueField="procedure_group_id" /> <ig:DataTreeNodeBinding DataMember="procedure" KeyField="procedure_id" TextField="procedure_name" ValueField="procedure_id" /> </DataBindings> </ig:WebDataTree>
My vb code:
Protected Sub wdtProcedure_NodeBound(sender As Object, e As Infragistics.Web.UI.NavigationControls.DataTreeNodeEventArgs) Handles wdtProcedure.NodeBound Dim oNode As Infragistics.Web.UI.NavigationControls.DataTreeNode = e.Node Dim oRowView As DataRowView = e.Node.DataItem.Item If oNode.Level = 1 Then oNode.TemplateId = wdtProcedureTemplate1.TemplateID oNode.EnsureTemplate() oNode.Editable = Infragistics.Web.UI.NavigationControls.DataTreeNodeEditableProps.On Dim oLabel As Label = oNode.FindControl("lblProcedureName") oLabel.Text = oRowView("procedure_name") 'Dim oWne As Infragistics.WebUI.WebDataInput.WebNumericEdit = oNode.FindControl("wneMultiplier") Dim oText As TextBox = oNode.FindControl("txtMultiplier") oText.Text = "1" If oRowView("multiplier_limit") > 0 Then oText.Visible = True 'oWne.MaxValue = oRowView("multiplier_limit") Else oText.Visible = False ' oWne.Visible = False End If End If End Sub
Renders great, but the only control in the system template that is "enabled" for lack of a better description is the checkbox. The textbox, dropdownlist are not editable. I tried both inside a table and outside a table and the checkbox is not something i really want to use, i was just trying different things.
Ultimately, I am happy turning on checkboxes and then having a custom template on the level 1 nodes that consists of a label and either a textbox or dropdownlist.
Hello Akcia, Thank you for posting in our forum.
A code sample will be greatly appreciated, since it will help me investigate the issue and not just drop suggestions. If not possible, please provide the markup code.
I am looking forward feedback from you.