Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
83 views
Hi,

I am using a RadCalendar control in my web page, to allow users to select/deselect non working days. I have it so there are 12 views displayed at once (3 x 4 grid). This means I can get a whole year's worth into one page.

What's quite annoying is that the previous/next months days sometimes appear in one view - which means in some cases the same day is repeated twice on the page, which is rather confusing and causes me trouble when determining if they have 'deselected' a day. Please select attached screenshot.

How can I make it so that each view only contains days for that month?

Princy
Top achievements
Rank 2
 answered on 30 Jul 2012
2 answers
122 views
I tried to recreate this demo: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

I copied the code given at the bottom of the page and made a few changes. I also changed the panel visibility to true since the panel and the items in it (the grid, tabs, panel background image) will not be displayed if the visibility is set to false. I don't know why you set the panel's visibility to false in the code given. Care to enlighten me on this?

However that's not the reason why I create this thread. When I tried to debug, I get this error message:

Could not find control 'Label1' in ControlParameter 'ParentID'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'Label1' in ControlParameter 'ParentID'.


I'm this close to tearing my hair out trying to debug this. Can you tell me what went wrong?

Here's my code:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="MiniApp5b._Default" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
 
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
 
<asp:SqlDataSource ID="edata3" runat="server" ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>" SelectCommand="SELECT * FROM [Category5Parent]">
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="edata5" runat="server"
        ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>"
        SelectCommand="
            SELECT *
            FROM Category5Child
                INNER JOIN Category5Parent
                ON Category5Child.ParentID = Category5Parent.ParentID
            WHERE ParentID = @ParentID
            ">
    <SelectParameters>
        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="Int32" Name="ParentID" />
    </SelectParameters>
</asp:SqlDataSource>
 
    <telerik:RadGrid ID="RadGrid4" runat="server" CellSpacing="0" DataSourceID="edata3" GridLines="None">
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ParentID"  DataSourceID="edata3">
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap1" Visible="true">
                    <telerik:RadTabStrip runat="server" ID="TabStrip1" MultiPageID="Multipage1" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
 
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="PageView1">
                            <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("ParentID") %>' Visible="false" runat="server" />
                            <telerik:RadGrid runat="server" ID="GridIntab" DataSourceID="edata5" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false">
                                 
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="ChildID" PageSize="7" HierarchyLoadMode="ServerOnDemand">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="ChildID" DataType="System.Int32"
                                            FilterControlAltText="Filter ChildID column" HeaderText="ChildID"
                                            ReadOnly="True" SortExpression="ChildID" UniqueName="ChildID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ChildName"
                                            FilterControlAltText="Filter ChildName column" HeaderText="ChildName"
                                            SortExpression="ChildName" UniqueName="ChildName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32"
                                            FilterControlAltText="Filter ParentID column" HeaderText="ParentID"
                                            SortExpression="ParentID" UniqueName="ParentID">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </telerik:RadPageView>
 
                        <telerik:RadPageView runat="server" ID="PageView2" Width="460px">
                        <%--
                        TO DO
                        --%>
                        </telerik:RadPageView>
 
                        <telerik:RadPageView runat="server" ID="PageView3">
                        <%--
                        TO DO
                        --%>
                        </telerik:RadPageView>
 
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
 
            <CommandItemSettings ExportToPdfText="Export to PDF">
            </CommandItemSettings>
 
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
 
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
 
            <Columns>
                <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32"
                    FilterControlAltText="Filter ParentID column" HeaderText="ParentID"
                    ReadOnly="True" SortExpression="ParentID" UniqueName="ParentID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ParentName"
                    FilterControlAltText="Filter ParentName column" HeaderText="ParentName"
                    SortExpression="ParentName" UniqueName="ParentName">
                </telerik:GridBoundColumn>
            </Columns>
 
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
</asp:Content>

Iris
Top achievements
Rank 1
 answered on 30 Jul 2012
0 answers
206 views
Hi,
I was trying to disabling the holidays and weekends in my calender.I was tried the below code and additional some code to achieve the purpose.This will disable all weekends and holidays in the current month(say July).And also will disable all weekends in the next month(say august).But it is not disabling holiday lists in the next month after changing the month to July to august.For example i need to disable 25-Dec-2012 in my calender.How can  do that? After changing the month the event "OnDayRender" not firing and disabling the days.Please help me?

<%@ Page Language="C#" %> 
<%@ Import Namespace="System.Data" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<script runat="server"
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        bool IsAlreadyLoaded = false
         
        if (!Page.IsPostBack) 
        { 
 
        } 
        if (!IsAlreadyLoaded) 
        { 
            Raddatepicker2.Calendar.SpecialDays.Clear(); 
            Raddatepicker2.SelectedDate = DateTime.Now; 
            IsAlreadyLoaded = true
        } 
    } 
 
 
    protected void Calendar_OnDayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) 
    { 
        if (e.Day.Date.DayOfWeek == DayOfWeek.Saturday || e.Day.Date.DayOfWeek == DayOfWeek.Sunday) 
        { 
            string otherMonthCssClass = "rcOutOfRange"
 
            e.Cell.Text = ""
            e.Cell.CssClass = "rcOutOfRange"
 
            Label label = new Label(); 
            label.Text = e.Day.Date.Day.ToString(); 
            e.Cell.Controls.Add(label); 
 
            RadCalendarDay calendarDay = new RadCalendarDay(); 
            calendarDay.Date = e.Day.Date; 
            calendarDay.IsSelectable = false
            calendarDay.ItemStyle.CssClass = otherMonthCssClass
            Raddatepicker2.Calendar.SpecialDays.Add(calendarDay); 
        } 
//Checking for holidays
if(e.Day.Date==HolidayDate)
{
            string otherMonthCssClass = "rcOutOfRange"
 
            e.Cell.Text = ""
            e.Cell.CssClass = "rcOutOfRange"
 
            Label label = new Label(); 
            label.Text = e.Day.Date.Day.ToString(); 
            e.Cell.Controls.Add(label); 
 
            RadCalendarDay calendarDay = new RadCalendarDay(); 
            calendarDay.Date = e.Day.Date; 
            calendarDay.IsSelectable = false
            calendarDay.ItemStyle.CssClass = otherMonthCssClass
            Raddatepicker2.Calendar.SpecialDays.Add(calendarDay);

}
    }  
     
</script> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<title>RadControls for ASP.NET AJAX</title> 
</head> 
<body> 
<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
<script type="text/javascript"
 
function OnDayRender(calendarInstance, args) 
    var jsDate = new Date(args._date[0], args._date[1] - 1, args._date[2]);  
    if (jsDate.getDay() == 0 || jsDate.getDay() == 6) {  
        var otherMonthCssClass = "rcOutOfRange"
        args.get_cell().className = otherMonthCssClass;  
        args.get_cell().innerHTML = "<span>" + args._date[2] + "</span>";  
        args.get_cell().DayId = "";  
    }  
 
</script> 
 
<telerik:RadDatePicker ID="Raddatepicker2" Skin="Office2007" Width="200px" MinDate="2009-01-01" 
    runat="server" MaxDate="2099-12-16"
    <DateInput ID="DateInput1" DateFormat="d" runat="server"
    </DateInput> 
    <Calendar ID="Calendar1" DayNameFormat="FirstTwoLetters" FirstDayOfWeek="Monday" 
        runat="server" OnDayRender="Calendar_OnDayRender" Skin="Office2007"
        <ClientEvents OnDayRender="OnDayRender" /> 
    </Calendar> 
</telerik:RadDatePicker>  
 
</form> 
</body> 
</html> 
Joby
Top achievements
Rank 1
 asked on 29 Jul 2012
0 answers
94 views
Hi,
    I am using the ImageManager separately using DialogOpener. I have a scenario that, I need to show the selected image by default when opening the image manager. Is there any way to do this?
tamil
Top achievements
Rank 1
 asked on 28 Jul 2012
0 answers
114 views
Hi,
    I am using the ImageManager separately using DialogOpener. I have a scenario that, I need to show the selected image by default when opening the image manager. Is there any way to do this?
tamil
Top achievements
Rank 1
 asked on 28 Jul 2012
0 answers
50 views
I am using radgrid control.in radgrid control <detailtables> is there. how can i put scrolling to detailtables?not for mastertable.kindly reply.
Venkat
Top achievements
Rank 1
 asked on 28 Jul 2012
2 answers
152 views
RadAsyncUpload isnt being consistent with the uploaded files. Attimes, it attempts to upload files that were uploaded in a previous upload, and attimes, it uploads the same file 2ce. I'm not sure what I causing the weird behaviour, but I need some help on this. Any suggestions?

It seems like when an upload is complete, the files uploaded are still being stored in the control somehow, so when a user tries to do a new upload, the files previously uploaded attempt to be uploaded again. What do I need to do to clear out already uploded files. I have ensured that the uploaded temporary files in the RadUploadtemp folder are cleaned out.


Thanks,
Akin
Vadim
Top achievements
Rank 1
 answered on 28 Jul 2012
6 answers
620 views
Before the update to RadControls for .NET 2012.1 215, I was using the following css rule to darken the text when the RadNumericTextBox is disabled:  .riDisabled { color: Black !important; }

Since the update, this no longer works for RadNumericTextBox though it still does for RadTextBox.  The new rendering places the riDisabled class on the input element which seems to hold the non-rounded value, but this value is not shown when the box is disabled.  There is no riDisabled class on the display span, nor is there an riDisabled class on the wrapper span.  The display span is now styled using its style attribute.

Even stranger, using the DisabledStyle-CssClass attribute places the specified class on the input rather than on the display span or the wrapper span.  Not sure how this could be useful.

This does not make sense to me.  Am I missing something obvious or is this an oversight that will be addressed in a later release?

Thanks for your help.

Chris
Shawn Krivjansky
Top achievements
Rank 1
 answered on 28 Jul 2012
1 answer
321 views
I am using ASP.NET MVC2 and RadEditor.
I am having a view based on Master page. This view contains a form generated using Html.BeginForm().
Please check 1.png. This view contains several sections having partial views. One of them is Style view (2.png)
The style view contains RadEditor in another partial view (2.png).
You may check the code in 3-6.png. Image 6 shows that i have to use <form> tag to show up the editor, but if remove the <form> tag editor is not shown up (7.png)

The major problem here is if i have use the <form> tag the editor is shown but because of nested forms the data after Style section is not submitted, while if i remove the <form> tag the editor is not shown up but entire data is submitted.

Can you please provide a solution on this.
Irfan Ahmed
Top achievements
Rank 2
 answered on 27 Jul 2012
5 answers
115 views
I have two RadListBoxes that are contained in a RadTabStrip. When I use the transfer buttons to move items from List1 to List2 and then click on a different tab, it throws me an error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Any ideas what index field it's talking about?

Also, occasionally when I click on the Tab that contains the two RadListBoxes, they randomly disappear. The items in both lists are still visible but they just overlap each other on the left side of the page.

Thanks in advance!
Brett
Top achievements
Rank 1
 answered on 27 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?