Hi. I'm trying to use findControl on a RadTreeNode on the client side to locate a radio button I have in the NodeTemplate, and I can't get it to locate it. I have tried just passing in the ID of the radio button in the code (RB1), and also the full client ID from the generated html. Each time, the control comes up null.
Also, is there is a way to get the client id of the current node if I have to construct the radio buttons client id?
One more: are there any other ways to access the controls under the node? Use the DOM? Is there a collection of controls availabe?
Thanks,
Brian
| <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Office2007" |
| OnClientNodeClicked="RadTreeView1_NodeClick" ShowLineImages="True" > |
| <Nodes> |
| <telerik:RadTreeNode runat="server" Text="Produce"> |
| <NodeTemplate> |
| <div> |
| <asp:RadioButton runat="server" ID="RB1" Text="Produce" GroupName="StandardTags" /><br /> |
| </div> |
| </NodeTemplate> |
| </telerik:RadTreeNode> |
| </Nodes> |
| </telerik:RadTreeView> |
In the js:
| function RadTreeView1_NodeClick(sender, eventArgs) |
| { |
| var node = eventArgs.get_node(); |
| var strControl = "RadTreeView1_i0_RB1"; |
| var radio = node.findControl(strControl); |
| ??? radio is null |
| } |
Hi,
The radcombobox does not expand when i have dropdowncssclass ="multipleRowsColumns" , it works fine when i remove the property. here is the code, any thoughts ?
<
telerik:RadComboBox ID="Country" runat="server" Skin="Sunset"
DataSourceID="Country" DataTextField="Text" DataValueField="Value"
DropDownCssClass="multipleRowsColumns" DropDownWidth="460px" AllowCustomText="false" >
</telerik:RadComboBox>
<
telerik:GridDateTimeColumn DataField="dtCreatedOn" DataType="System.DateTime" DataFormatString="{0:M/dd/yyyy}"
FilterControlWidth="120px" HeaderText="Created On" SortExpression="dtCreatedOn"
UniqueName="dtCreatedOn">
However the filter menu options listed below do not function
EqualTo: Not working
NotEqualTo: Not working
Greaterthan: Not working proper (NOTE: working as Greater than Equal)
LessThanOrEqualTO: Not working (Note: Working as Lessthan)
I need help on this
thanks
MS
<%
@ Control Language="C#" AutoEventWireup="true" CodeBehind="ComboBox.ascx.cs" Inherits="PortalGridPage.ComboBox" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="radUI" %>
<
asp:Panel runat="server" ID="ComboBoxPanel" CssClass="ComboBoxPanel">
<asp:Label runat="server" ID="TheLabel" >
</asp:Label>
<radUI:RadComboBox runat="server" ID="TheComboBox"
EnableEmbeddedScripts="True"
AllowCustomText="True" AutoPostBack="True" >
</radUI:RadComboBox>
</
asp:Panel>
<
head runat="server">
<title></title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager id="ScriptManager" ScriptMode="Release" runat="server" />
<script type="text/javascript" src="PortalConfigPage.js"></script>
<script type="text/javascript" src="..\WebResourcesAjax\ValcoGridPanel\Scripts\ValcoGridPanel.js"></script>
<div>
<radUI:RadWindowManager ID="TheWindowManager" runat="server"
Skin="Default" >
<Windows>
<radUI:RadWindow ID="TheChildWindow" runat="server" Height="400px" Width="700px"/>
</Windows>
</radUI:RadWindowManager>
<radUI:RadAjaxLoadingPanel ID="TheAjaxLoadingPanel" runat="server" Transparency="15"
IsSticky="True" Style="position: absolute; left: 200; top: 60; z-index: 999;"
Height="240px" Width="240px">
<asp:Image ID="Image1" runat="server" Height="160px" Width="240px" AlternateText="Loading..." />
</radUI:RadAjaxLoadingPanel>
<RadUI:RadAjaxPanel ID="TheAjaxPanel" runat="server"
EnableAJAX="True" EnableEmbeddedScripts="True" LoadingPanelID="TheAjaxLoadingPanel"
EnableViewState="True" >
<asp:Button ID="EditLayout" runat="server" EnableViewState="False" Text="Edit Page Config" />
<asp:Panel ID="ControlArea" runat="server"
EnableViewState="True" >
</asp:Panel>
<asp:Button ID="SaveLayout" runat="server" EnableViewState="False" Text="Save Config" />
<asp:Button ID="CancelButton" runat="server" EnableViewState="False" Text="Cancel" />
</RadUI:RadAjaxPanel>
</div>
</form>
</
body>
</
html>
base.OnInit(e);
TheComboBox.EnableEmbeddedSkins = PortalGridPage.Properties.
Settings.Default.UseEmbeddedSkins;
TheComboBox.Skin = PortalGridPage.Properties.
Settings.Default.Skin;
private
class myNTemplate : ITemplate
{
string TempField = string.Empty;
public myNTemplate(string Field)
{
TempField = Field;
}
#region
ITemplate Members
public void InstantiateIn(Control container)
{
RadNumericTextBox ntextBox = new RadNumericTextBox();
ntextBox.EnableEmbeddedSkins =
false;
ntextBox.Width =
Unit.Pixel(25);
ntextBox.ID =
"ntxt_" + TempField;
ntextBox.DataBinding +=
new EventHandler(ntextBox_DataBinding);
container.Controls.Add(ntextBox);
}
void ntextBox_DataBinding(object sender, EventArgs e)
{
RadNumericTextBox ntextBox = (RadNumericTextBox)sender;
GridDataItem container = (GridDataItem)ntextBox.NamingContainer;
string fieldValue = DataBinder.Eval(container.DataItem, TempField).ToString();
ntextBox.Text = (
string)((DataRowView)container.DataItem)[TempField];
}
#endregion
}
As the gris is ready i started entering values in each of mueric box in each column and need to insert into Db
As they were template columns i used FindControls to get the values and found only null was returning, not able to find the reason, for this iam sending my code for inserting
foreach (GridDataItem item in this.Rg_LOB.MasterTableView.Items)
{
_obj_smhr_lob.LOB_EMPID =
Convert.ToInt32(item.Cells[2].Text);
for (int j = 0; j < Rg_LOB.Columns.Count - 5; j++)
{
strQry.Append(
"EXEC USP_SMHR_LEAVEOPENINGBALANCES ");
_obj_smhr_lob.LOB_EMPID =
Convert.ToInt32(item.Cells[2].Text);
string LT = Convert.ToString(Rg_LOB.MasterTableView.Columns[j + 4].UniqueName);
string[] T = LT.Split(new char[] { '-' });
_obj_smhr_lob.LOB_LEAVETYPEID =
Convert.ToInt32(T[0]);
string ctrl = "ntxt_" + LT;
RadNumericTextBox ntxt;
ntxt = (
RadNumericTextBox)item[this.Rg_LOB.MasterTableView.Columns[j + 4].UniqueName].FindControl(ctrl);
_obj_smhr_lob.LOB_NOOFDAYS =
Convert.ToInt32(ntxt.Text);
_obj_smhr_lob.LOB_FINALISE = 0;
_obj_smhr_lob.LOB_CREATEDBY = 1;
_obj_smhr_lob.LOB_CREATEDDATE = System.
DateTime.Now;
_obj_smhr_lob.LOB_LASTMDFBY = 1;
_obj_smhr_lob.LOB_LASTMDFDATE = System.
DateTime.Now;
_obj_smhr_lob.OPERATION =
operation.Insert;
string str = "@Operation = 'Insert'" +
",@LOB_EMPID = '" + _obj_smhr_lob.LOB_EMPID + "'" +
",@LOB_LEAVETYPEID = '" + _obj_smhr_lob.LOB_LEAVETYPEID + "'" +
",@LOB_NOOFDAYS = '" + _obj_smhr_lob.LOB_NOOFDAYS + "'" +
",@LOB_FINALISE = '" + _obj_smhr_lob.LOB_FINALISE + "'" +
",@LOB_CREATEDBY = '" + _obj_smhr_lob.LOB_CREATEDBY + "'" +
",@LOB_CREATEDDATE = '" + _obj_smhr_lob.LOB_CREATEDDATE + "'" +
",@LOB_LASTMDFBY = '" + _obj_smhr_lob.LOB_LASTMDFBY + "'" +
",@LOB_LASTMDFDATE = '" + _obj_smhr_lob.LOB_LASTMDFDATE + "'";
strQry.Append(str);
}
}
I kept the line in bold where iam getting null. Please help me out in finding the error
Thanks
MKD