Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
175 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
68 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
84 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
44 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
122 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
511 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
288 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
99 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
4 answers
108 views
Hi,

I was wondering if there is way to add some sort of 'ClearFilter' text/image button at the intersection of the 'Filter Row' and 'ExpandCollapse Column'.

I tried this and there is no change in the UI -
<ExpandCollapseColumn Visible="true">
                <FilterTemplate>
                    <asp:ImageButton Width="20px" ImageUrl='~/images/ClearFilter.gif' AlternateText="C" runat="server"                                       OnClick="OnClearFilterBtnClick" Style="vertical-align: middle" />
                </FilterTemplate>
            </ExpandCollapseColumn>

Attached the snapshot of the UI -

Nithya
Top achievements
Rank 1
 answered on 27 Jul 2012
1 answer
109 views
Hi,

I am using a Telerik RadGrid to display records I get from executing a stored procedure. The records that are returned from the stored procedure are stored in a DataSet which are then bound to the Grid's Data Source property using the following line of code

grid.DataSource=ds["Table"].DefaultView;
grid.DataBind

Depending on a few check boxes clicked on the page the stored procedure will either execute a join or execute a simple SQL query.

The simple query uses a SELECT * Statement
e.g.
SELECT * FROM Table1 WHERE Table1.Key=@Key

wheres the join statement uses a SELECT DISTINCT
e.g.
SELECT DISTINCT Table1.UserKey, Table1.UserName FROM Table1 INNER JOIN Table 2 on Table1.Key=Table2.ParentKey WHERE Table1.UserKey=@UserKey.

Both queries execute in under a second (we tested this SQL Server Management Studio). The SELECT * Statement returns around 300 records and SELECT DISTINCT returns around 200 records.

Even though the SELECT DISTINCT has fewer records it takes around 10-15 seconds more for the page to render than the SELECT * Statement.

We would really appreciate your feedback on this problem.

ASPX For the telerik grid is as follows

<telerik:RadGrid ID="dgSearch" CssClass="RadGrid RadGrid_CSMi" runat="server" Width="730px"

Font-Size="8pt" AllowSorting="True" AllowPaging="True" PageSize="5" AutoGenerateColumns="False"

EnableEmbeddedSkins="false" OnSelectedIndexChanged="dgSearch_SelectedIndexChanged">

<PagerStyle Mode="NextPrevAndNumeric" />

<AlternatingItemStyle BackColor="#C4E1FF" />

<MasterTableView Width="100%" DataKeyNames="AthleteKey">

<Columns>

<tec:GridButtonColumnWithFilteringSorting HeaderText="Full Name" UniqueName="FullName"

SortExpression="FullName" DataTextField="FullName" DataField="FullName" CommandName="Select"

ButtonType="LinkButton" />

<telerik:GridBoundColumn DataField="ID" HeaderText="ID" />

<telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" ReadOnly="True" />

<telerik:GridBoundColumn DataField="StatusPractice" HeaderText="Practice Status" />

<telerik:GridBoundColumn DataField="StatusGame" HeaderText="Game Status" />

<telerik:GridBoundColumn DataField="ReleaseDate" HeaderText="Release Date" />

</Columns>

</MasterTableView>

<FilterMenu EnableEmbeddedSkins="False" EnableImageSprites="False">

</FilterMenu>

</telerik:RadGrid>


Thanks,
CSMi
Marin
Telerik team
 answered on 27 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?