This is a migrated thread and some comments may be shown as answers.

[Solved] Error on Datepicker control

5 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 31 Jul 2009, 09:55 AM

Hi,

I am a licensed customer for Telerik 2009. I found the following problem with Datepicker control.

I am using RadGrid in my application. In that I used an Usercontrol [Custom Template] for Editing/Adding an new item to the grid.

In Usercontrol I need to select Date so i used Datepicker control, but the date selection window not opened when you press popup button

.

Thanks in Advance

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 05 Aug 2009, 07:46 AM
Hello santhosh,

Probably there is a Javascript error on the page, which stops some/all scripts from executing. Please check.

If you need further assistance with this, please send us a runnable web page, which reproduces the problem, so that we can see what's going on.


Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Santhosh
Top achievements
Rank 1
answered on 05 Aug 2009, 11:49 AM
thank you for your reply,  I was pasted the page code below, can you verify it

Main Page having RadGrid

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="Procurement_Main.ascx.cs" Inherits="Procurement.Procurement_Main" %>

 

<%

@ Register assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.DynamicData" tagprefix="cc1" %>

 

<%

@ Register assembly="Telerik.Web.UI, Version=2009.1.402.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

<

 

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script language="javascript" type="text/javascript">

 

 

var PageRefreshFlag;

 

 

function OpenPopup(Url, PageRefresh) {

 

PageRefreshFlag = PageRefresh;

 

var index = 0;

 

 

var wnd = window.radopen(Url, null);

 

 

//return false;

 

}

 

function RefreshPage() {

 

 

if (PageRefreshFlag == true)

 

location.reload(

true);

 

}

 

</script>

 

</

 

telerik:RadCodeBlock>

 

<

 

style type="text/css">

 

.contactWrap

{

padding:10px 15px 15px 15px;

background:#fff;

color:#333;

}

.contactWrap td

{

padding:0 20px 0 0;

}

.contactWrap td td

{

padding:3px 20px 3px 0;

}

.contactWrap img

{

border:1px solid #05679d;

}

 

</style>

 

<

 

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

 

<

 

h4>ITX Procurement - Materials </h4>

 

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="GridMain">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="GridMain" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

</

 

telerik:RadAjaxManager>

 

<

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Direction="LeftToRight" Skin="WebBlue"/>

 

 

<telerik:RadGrid ID="GridMain" runat="server" AllowPaging="True"

 

 

AllowSorting="True"

 

 

GridLines="None"

 

 

onneeddatasource="GridMain_NeedDataSource" Skin="WebBlue"

 

 

onitemcommand="GridMain_ItemCommand"

 

 

onupdatecommand="GridMain_UpdateCommand"

 

 

AutoGenerateColumns="False"

 

 

OnDetailTableDataBind="RadGrid1_DetailTableDataBind" Width="850px"

 

 

HierarchySettings-ExpandTooltip="Expand to View Material Ratios">

 

 

<HeaderStyle Wrap="false"/>

 

 

<PagerStyle AlwaysVisible="true" Mode="NumericPages" />

 

<

 

MasterTableView DataKeyNames="Material Name" Width="830px">

 

 

<EditFormSettings EditFormType="WebUserControl">

 

 

<EditColumn UniqueName="EditCommandColumn1"></EditColumn>

 

 

</EditFormSettings>

 

 

<ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn EditText="&lt;img src=/_layouts/ITXProcurement/Edit.gif style='border:0'/&gt; Edit" ItemStyle-Width="130" HeaderText="" HeaderStyle-Width="0px"></telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn DataField="TaskUID" Visible="false" Display="false" HeaderStyle-Width="0" HeaderText="" ItemStyle-Width="0"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="MaterialID" Visible="false" Display="false" HeaderStyle-Width="0" HeaderText="" ItemStyle-Width="0"> </telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Material Name" HeaderText="Material Name"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Planned Actual Date" HeaderText="Planned Actual Date"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Planned Quantity" HeaderText="Planned Quantity" ></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Actual Delivery Date" HeaderText="Actual Delivery Date"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Actual Quantity" HeaderText="Actual Quantity"></telerik:GridBoundColumn>

 

 

</Columns>

 

 

<DetailTables>

 

 

<telerik:GridTableView DataKeyNames="MaterialName" Name="Orders" Width="100%">

 

 

<PagerStyle AlwaysVisible="false" Mode="NumericPages" />

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="hidden" ItemStyle-Width="10%"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="MaterialName" HeaderText="Material Name" ItemStyle-Width="30%"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" ItemStyle-Width="30%"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Unit" HeaderText="Unit" ItemStyle-Width="30%"></telerik:GridBoundColumn>

 

 

</Columns>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

</

 

MasterTableView>

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="True" />

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

</

 

telerik:RadGrid>

 

 

<div style="text-align:right;width:850px;"><br />

 

 

<asp:Button ID="BtnUpdate" runat="server" Text="Update Project" Height="25px"

 

 

Width="150px" onclick="BtnUpdate_Click" /></div>

 

 

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="WebBlue" />

 

 

<telerik:RadWindowManager ID="Singleton" Width="600" Height="600" Modal="true"

 

 

VisibleStatusbar="false" runat="server" Behavior="Close"

 

 

OnClientClose="RefreshPage" Skin="WebBlue" > </telerik:RadWindowManager>

 

</

 

telerik:RadAjaxPanel>

 


 

 

 




And  the below page is for Template [Usercontrol]

 

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddNewProcurementItem.ascx.cs" Inherits="Procurement.AddNewProcurementItem" %>

 

<%

@ Register Assembly="Telerik.Web.UI, Version=2009.1.402.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"

 

 

Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

table style="width:100%">

 

 

<tr>

 

 

<td style="text-align:right;">Actual Delivery Date:</td>

 

 

<td style="width:100px;">

 

 

<telerik:RadDatePicker ID="DtpActDelDate" Runat="server" AutoPostBack="True"

 

 

Culture="English (United States)" Skin="Default" Width="100px"

 

 

SelectedDate='<%# Convert.IsDBNull(DataBinder.Eval(Container, "DataItem.Actual Delivery Date")) ? DateTime.Now : Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.Actual Delivery Date")) %>'>

 

 

<Calendar ID="Calendar1" runat="server" ViewSelectorText="x"></Calendar>

 

 

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>

 

 

</telerik:RadDatePicker></td>

 

 

<td style="width:20%;text-align:right;">Actual Quantity:</td>

 

 

<td style="width:100px"><telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server"

 

 

Skin="WebBlue" Width="100px" Value='<%# Convert.IsDBNull(DataBinder.Eval(Container, "DataItem.Actual Quantity")) ? 0 : Convert.ToInt64(DataBinder.Eval(Container, "DataItem.Actual Quantity"))%>' >

 

 

</telerik:RadNumericTextBox></td>

 

 

</tr>

 

 

<tr style="text-align:right;">

 

 

<td colspan="2"></td>

 

 

<td><asp:Image ID="ImgUpdate" style='border:0px' runat="server" AlternateText='' />

 

 

<asp:LinkButton ID="LinkButton1" runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>' Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'>

 

 

</asp:LinkButton></td>

 

 

<td>

 

 

<asp:Image ID="ImgCancel" style='border:0px' runat="server" AlternateText='' />

 

 

<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Cancel" Text="Cancel" ></asp:LinkButton>

 

 

</td>

 

 

</tr>

 

</

 

table>

 




I think now you can reproduce the problem with these code.


0
Yavor
Telerik team
answered on 10 Aug 2009, 08:09 AM
Hi santhosh,

I reviewed the code, and it looks correct.
To further address the issue at hand, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your logic, and the unwanted behavior. We will review it locally, and get back to you with additional information.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Santhosh
Top achievements
Rank 1
answered on 10 Aug 2009, 09:43 AM
Hi Admin,

thank you for your response. after a littile bit of work i found that when you remove the 'Ajax - Loading Panel' from the code it works fine. Is that possible for you to find out the problem? In the mean time let me create a sample project for you.

Thank you.

Reagards,
Santhosh.
0
Yavor
Telerik team
answered on 12 Aug 2009, 10:21 AM
Hi santhosh,

I do not think the cause is in the AjaxLoadingPanel. Nevertheless, once you send us the working project, I will debug it, and get back to you with more precise information on the matter at hand.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Santhosh
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or