
| <%@ Control Language="C#" CodeFile="RichDateTime_Edit.ascx.cs" Inherits="Text_EditField" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <telerik:RadDateTimePicker SelectedDate='<%# FieldValue %>' |
| ID="RadDateTimePicker1" runat="server" AutoPostBack="True" |
| AutoPostBackControl="Both" Culture="English (United States)" Skin="Telerik"> |
| <TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton> |
| <TimeView CellSpacing="-1"></TimeView> |
| <DateInput AutoPostBack="True"> |
| </DateInput> |
| <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" |
| ViewSelectorText="x" Skin="Telerik"></Calendar> |
| <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton> |
| </telerik:RadDateTimePicker> |
| <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="droplist" ControlToValidate="RadDateTimePicker1" Display="Dynamic" Enabled="false" /> |
| <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" CssClass="droplist" ControlToValidate="RadDateTimePicker1" Display="Dynamic" Enabled="false" /> |
| <asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="droplist" ControlToValidate="RadDateTimePicker1" Display="Dynamic" /> |
| using System; |
| using System.Data; |
| using System.Configuration; |
| using System.Collections; |
| using System.Collections.Specialized; |
| using System.Linq; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using System.Xml.Linq; |
| using System.Web.DynamicData; |
| public partial class Text_EditField : System.Web.DynamicData.FieldTemplateUserControl { |
| protected void Page_Load(object sender, EventArgs e) { |
| RadDateTimePicker1.ToolTip = Column.Description; |
| SetUpValidator(RequiredFieldValidator1); |
| SetUpValidator(RegularExpressionValidator1); |
| SetUpValidator(DynamicValidator1); |
| } |
| protected override void ExtractValues(IOrderedDictionary dictionary) |
| { |
| dictionary[Column.Name] = ConvertEditedValue(RadDateTimePicker1.SelectedDate.ToString()); |
| } |
| public override Control DataControl { |
| get { |
| return RadDateTimePicker1; |
| } |
| } |
| } |
<
telerik:radcombobox id="cmboUsers" runat="server" radcomboboximageposition="Right">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Select a user..."></telerik:RadComboBoxItem>
</Items>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
<ExpandAnimation Type="OutQuart"></ExpandAnimation>
</telerik:radcombobox>
<
body onload="fnMaxWindow();fnSetFocus();">
My JavaScript code looks like:
<script language="javascript" type="text/javascript">
function fnSetFocus()
{
var combo = $find("<%= cmboUsers.ClientID %>");
alert("combo = " + combo);
var inputArea = combo.get_inputDomElement();
alert("inputArea = " + inputArea);
inputArea.focus();
}
function fnMaxWindow() {
window.moveTo(0,0);
window.resizeTo(screen.width, screen.height);
}
</script>
When this runs, I get "combo = null" on the first alert, indicating that the $find code doesn't work.
Thanks in advance for the help.
function promptCallBackFn(arg) {
if (arg != null) {
var tree = $find("<%= RadTreeView1.ClientID %>");
if (tree.get_selectedNode() != null) {
var node = tree.get_selectedNode();
AddNode(tree.get_selectedNode(), arg);
}
}
}
function AddNode(node, foldername) {
var treeView = $find("<%= RadTreeView1.ClientID %>");
treeView.trackChanges();
var childNode = new Telerik.Web.UI.RadTreeNode();
childNode.set_text(foldername);
childNode.set_imageUrl("Img/mailfolder.gif");
childNode.set_expandMode("Telerik.Web.UI.TreeNodeExpandMode.WebService");
node.get_nodes().add(childNode);
treeView.commitChanges();
}
But When I test this,Error Occured.after I expand the Selected node first, this run well.
So I think mayby I should expanded the selected node first in my code,but it still couse error.
My questions is how to add node when we use LoadOnDemand - Webservice mode in client side.
I need a callback function to make sure that the select Node is Expanded successful and how to do this.
