Hi,
I have a problem with RadDatePicker controls in Asp.Net.
I am dynamically creating 2 RadDatePicker controls at runtime and I want to apply CompareValidator to check if the 'From Date' is less than the 'To Date'. The controls are dynamically created so i have set the AutoPostBack = false. With that the controls are not throwing the validation if i choose the wrong dates.
The condition is:
Date Validation checks - From Date <= To date
Here is my code:
for (int j = 0; j < slistArray.Length; j++)
{
int counter = 0;
int DateRangeFound = 0;
switch (QuestionType)
{
case "DateRange":
if (QuestionName == "DateFrom")
{
RadDatePicker rdpDateFrom = new RadDatePicker();
rdpDateFrom.CssClass = "form-control form-control-item";
rdpDateFrom.ID = "rdpDateFrom" + j.ToString() + "-" + counter;
rdpDateFrom.AutoPostBack = false;
rdpDateFrom.DatePopupButton.Visible = true;
rdpDateFrom.ShowPopupOnFocus = true;
rdpDateFrom.EnableScreenBoundaryDetection = true;
rdpDateFrom.MaxDate = DateTime.Now;
txtC1.Controls.Add(rdpDateFrom);
++DateRangeFound;
}
else if (QuestionName == "DateTo")
{
RadDatePicker rdpDateTo = new RadDatePicker();
rdpDateTo.CssClass = "form-control form-control-item";
rdpDateTo.ID = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
rdpDateTo.AutoPostBack = false;
rdpDateTo.DatePopupButton.Visible = true;
rdpDateTo.ShowPopupOnFocus = true;
rdpDateTo.EnableScreenBoundaryDetection = true;
rdpDateTo.MaxDate = DateTime.Now;
txtC1.Controls.Add(rdpDateTo);
++DateRangeFound;
}
if (DateRangeFound > 1)
{
CompareValidator cvdpDate = new CompareValidator();
cvdpDate.ID = "cvdpDate" + j.ToString() + "-" + counter;
cvdpDate.ControlToCompare = "rdpDateFrom" + j.ToString() + "-" + (counter - 1);
cvdpDate.ControlToValidate = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
cvdpDate.Operator = ValidationCompareOperator.GreaterThanEqual;
cvdpDate.Type = ValidationDataType.Date;
cvdpDate.Text = "*";
cvdpDate.ForeColor = Color.Red;
cvdpDate.ErrorMessage = "End date must be equal or greater than start date - please correct dates.";
txtC1.Controls.Add(cvdpDate);
}
break;
}
panelBody.Controls.Add(txtC1);
counter++;
}
Any suggestions for the client side jquery validation will also be helpful.
Thank you.

I am currently attempting to add custom nodes to the file explorer view, with the selection of the lowest level of each node displaying the contents of multiple listed directories (create nodes with custom names as their own 'custom trees' where the contents of the corresponding listview would include those of directory1 + 2 + 3 etc.) Here is what I have so far, and I am looking for the equivalent value of the 'viewpath' from the main fileexplorer object for each individual node.
protected void BindDataTable()
{
RadTreeNode temp_node;
DataTable node_template = CreateDirectoryTable();
foreach (DataRow row in node_template.Rows)
{
temp_node = new RadTreeNode();
temp_node.Text = (string)row[1];
temp_node.Value = (string)row[2];
FileExplorerBase.TreeView.Nodes.Add(temp_node);
}
}
Is it a simple property in the node object? Because I cannot seem to find it. Or is this functionality present in the treeview object directly?

<
telerik:RadGrid ID="RadGrid1" runat="server">
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200">
</CollapseAnimation>
</HeaderContextMenu>
<MasterTableView CommandItemDisplay="Top" DataKeyNames="Contact_ID" Width="100%"
ExpandCollapseColumn-Display="true" HierarchyDefaultExpanded="false"
EditMode="EditForms" AllowPaging="True" PageSize="5">
<ItemTemplate>
<span lang="en-us">ITEM TEMPLATE</span>
</ItemTemplate>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<asp:DropDownList ID="cboCountry" runat="server" Enabled="false">
</asp:DropDownList>
<asp:Button runat="server" ID="butCountry" text="change" CausesValidation="False"
CommandName="ChangeCountry" />
<br />
<br />
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200">
</CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>
Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Dim strCommand As String
strCommand = e.CommandName.ToUpper
Select
Case strCommand
Case Is = "CHANGECOUNTRY"
Dim editItem As GridDataItem = CType(e.Item, GridDataItem)
Dim
ContactCombo As DropDownList = CType(editItem.FindControl("cboCountry"), DropDownList)
ContactCombo.Enable = "True"
End Select
End Sub

We have a rad grid.We are binding the grid using datatable and auto generated columns are true.
We want to add all the cell values and display the sum of all the cell values in other column when cell click.
we have tried with row selected event but the sum is not displaying properly when moving from one cell to other.
Please help us to fix the issue.
1. We are
able to fetch the selected cell value but unable to fetch the remaining
corresponding cell values. You can find the same in the sample project
(BatchEdit.aspx – OnBatchEditCellValueChanged event)
2. We are
able to fetch the selected cell value and corresponding cell values in the same
row by hardcoding the column names, but dynamically we are unable to get the
values of the cell. You can find the same in the sample project
(OnRowSelected.aspx – OnRowSelected event)
we have used the following code
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript">
function RowSelected(sender, eventArgs) {
var grid = sender;
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
var cell1 = MasterTable.getCellByColumnUniqueName(row, "Value1");
var cell2 = MasterTable.getCellByColumnUniqueName(row, "Value2");
var cell3 = MasterTable.getCellByColumnUniqueName(row, "Value3");
var cell4 = MasterTable.getCellByColumnUniqueName(row, "Value4");
var total = 0;
var arr = [];
var total = 0;
var columnlength = grid.get_masterTableView().get_columns().length;
for (i = 0 ; i < columnlength; i++) {
cell = grid.get_masterTableView().get_columns()[i].get_uniqueName();
var cell = MasterTable.getCellByColumnUniqueName(row, cell);
var val = parseInt(cell.innerText);
arr[i] = val;
}
for (i = 1; i < arr.length; i++) {
total += arr[i];
}
var cell1 = MasterTable.getCellByColumnUniqueName(row, "Sum");
cell1.innerText = total;
cell1.eventArgs.set_cancel(true);
}
</script>
<%-- var grid = $find("<%=RadGrid1.ClientID%>");
var tableView = sender.get_masterTableView();
var batchManager = sender.get_batchEditingManager();
var items = tableView.get_dataItems();
var mapValues = [];
for (var i = 0; i < items.length; i++) {
var mapCell = items[i].get_cell("Map");
var mapValue = batchManager.getCellValue(mapCell);
mapValues.push(mapValue);
}--%>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<asp:HiddenField ID="HiddenField1" runat="server" />
<div>
<telerik:RadGrid ID="RadGrid1" runat="server">
<MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Cell" >
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True" CellSelectionMode="MultiCell" />
<ClientEvents OnRowClick="RowSelected" />
</ClientSettings>
</telerik:RadGrid>
</div>
</form>
</body>
</html>
and code behind is
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class OnRowSelected : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GetValues();
}
private void GetValues()
{
DataTable dtTable = new DataTable();
dtTable.Columns.Add("Sum");
dtTable.Columns.Add("Value1"); dtTable.Columns.Add("Value2");
dtTable.Columns.Add("Value3"); dtTable.Columns.Add("Value4");
DataRow dr = dtTable.NewRow();
dr["Sum"] = "";
dr["Value1"] = "1"; dr["Value2"] = "2";
dr["Value3"] = "3"; dr["Value4"] = "4";
dtTable.Rows.Add(dr);
DataRow drr = dtTable.NewRow();
drr["Sum"] = "";
drr["Value1"] = "5"; drr["Value2"] = "6";
drr["Value3"] = "7"; drr["Value4"] = "8";
dtTable.Rows.Add(drr);
RadGrid1.DataSource = dtTable;
RadGrid1.DataBind();
}
}
Any other information please contact us.

Hi
Is there a equivalent to the $(document).on function for the clientSelectedIndexChanging and clientSelectedIndexChanged events for a RadCombobox in jQuery?

Hi,
I have radgrid with the possibility of adding a line.
One column is of GridDropDownColumn.
How to play the DropDown ??
Thank you.

We recently updated to the newest version 2015.2.729.40 and our Rotator image onclick doesn't work in Chrome and doesn't work on some machines in IE.
We had <asp:Image controls in our rotator which are rendered as <mg
To correct this, we had to change the control type to <asp:ImageButton which renders as <input
Again, this issue only happened after our recent updated to version 2015.2.729.40
Simplified example below
<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default1.aspx.vb" Inherits="TestWebRoot._Default" %><!DOCTYPE html><html><head runat="server"> <title></title> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> //Put your JavaScript code here. </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <telerik:RadRotator ID="RadRotator1" runat="server" Height="300px" Width="823px" BackColor="White" ScrollDuration="5000" FrameDuration="10000" ItemHeight="300px" ItemWidth="823px" PauseOnMouseOver="true" RotatorType="SlideShow" ScrollDirection="Left" BorderWidth="0px" SlideShowAnimation-Type="CrossFade" WrapFrames="False"> <Items> <telerik:RadRotatorItem> <ItemTemplate> <table style="position: relative;"> <tr> <td style="vertical-align: top;"> <div class="Center ProductLabel" style="width: 100%; height: 20px;"> img control </div> <img id="Img2" runat="server" src="~/images/logo.jpg" style="width: 50px; height: 50px;" alt="My Image" onclick="alert('here'); return false;" title="MyTitle" /> </td> </tr> <tr> <td> <div class="Center ProductLabel" style="width: 100%; height: 20px;"> ImageButton </div> <asp:ImageButton ID="Image1" runat="server" style="width: 50px; height: 50px;" AlternateText="My Image" ImageUrl="~/images/logo.jpg" OnClientClick="alert('here'); return false;" /> </td> </tr> </table> </ItemTemplate> </telerik:RadRotatorItem> </Items> </telerik:RadRotator> Test Image outside Rotator <img id="Img1" runat="server" class="Link" src="~/images/logo.jpg" onclick="alert('here');" /> </form></body></html>I am having a strange problem. First let me start by saying that I am using the Telerik controls supplied by DotNetNuke. So I can not "upgrade" to any other version of the Telerik controls. I am stuck with what I am given.
I wrote a module initially using Telerik v2012.2.724.35 (which was bundled with DNN v6.02.09)and it worked great. I unfortunately am forced to upgrade to a new DNN version because of a bog in Telericks RADSchedule (which effect the month of November only). So...now I am running DNN that comes with Telerik v2013.1.403.40
The problem is that when I click on a button inside the RADGrid and the ItemCommand event fires, previously I was able to obtain the value of each cell in the row that the button was activated in. The *same exact code* running in v2013.1.403.40 of Telerick now returns to me " " for every single cell in the row. It's like the new Telerik version doesn't bind the data to the GridDataItem (e.Item) within the ItemCommand event like it used to.
What am I missing? How do I get the selected row's data like I had before?
I have a HTMLChart that I would like to allow a user to right click on a point on the graph and set a start date and then right click on a second point and set the end date. After the points are set it would then pass the dates into a stored procedure and update the HTMLChart. How would I go about doing this? The chart is currently being populated via server-side code.
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Visible="false" Legend-Appearance-Position="Top" Width="95%"> <ClientEvents OnLoad="BottomXAxisLabels" OnSeriesClick="OnSeriesClick" /> <PlotArea> <Series> <telerik:ScatterLineSeries DataFieldY="ReturnedValue" DataFieldX="cycle_Date"> <TooltipsAppearance Color="White" > </TooltipsAppearance> <LabelsAppearance Visible="false"> </LabelsAppearance> </telerik:ScatterLineSeries> </Series> <YAxis> <LabelsAppearance> <TextStyle Bold="true" /> </LabelsAppearance> <MinorGridLines Visible="false"></MinorGridLines> <MajorGridLines Visible="false"></MajorGridLines> </YAxis> <XAxis DataLabelsField="cycle_Date" BaseUnit="Years" MajorTickSize="1" > <LabelsAppearance Visible="true" RotationAngle="90" DataFormatString="Year {0:yyyy}"> <TextStyle Bold="true" /> </LabelsAppearance> <TitleAppearance Text="Dates"> <TextStyle Bold="true" /> </TitleAppearance> <MinorGridLines Visible="false"></MinorGridLines> <MajorGridLines Visible="true"></MajorGridLines> </XAxis> </PlotArea> <ChartTitle> <Appearance> <TextStyle Bold="true" /> </Appearance> </ChartTitle> <Legend> <Appearance Visible="true" Position="Bottom"></Appearance> </Legend> </telerik:RadHtmlChart> </telerik:RadAjaxPanel>