Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
780 views
Hi ,

I try to implement the sample http://www.telerik.com/community/code-library/aspnet-ajax/calendar/disabling-calendar-days.aspx ti disable the weekend day.

But the result is very strange. He don't disable the weekend days but the 4 days of the first week and  3 day on the last week.
I say that the sample was from 2007 (little bit old ;-) ) and it was needed to change little think (like i found in other post).
But this change don't solve my problem.

Any issue would be appreciate.

Thanks

Edwin.

Here my code:

// necessary to disable the weekends on client-side navigation 
    function OnDayRender(calendarInstance, args) { 
        // convert the date-triplet to a javascript date 
        // we need Date.getDay() method to determine  
        // which days should be disabled (e.g. every Saturday (day = 6) and Sunday (day = 0))                 
        var jsDate = new Date(args._date[0], args._date[1] - 1, args._date[2]); 
        if (jsDate.getDay() == 0 || jsDate.getDay() == 6) { 
            var otherMonthCssClass = "otherMonth_" + calendarInstance.Skin; 
            args.Cell.className = otherMonthCssClass
            // replace the default cell content (anchor tag) with a span element  
            // that contains the processed calendar day number -- necessary for the calendar skinning mechanism  
            args.Cell.innerHTML = "<span>" + args._date[2] + "</span>"; 
            // disable selection and hover effect for the cell 
            args.Cell.DayId = ""
        } 
    } 
 
 
<telerik:RadDatePicker ID="Raddatepicker2" Style="vertical-align: middle;" Skin="Office2007" Width="200px" 
                            MinDate="2009-01-01" runat="server" MaxDate="2099-12-16" Culture="Dutch (Netherlands)"
                            <DateInput onclick="ToggleSecondPopup()" DateFormat="d" runat="server"></DateInput> 
                            <Calendar DayNameFormat="FirstTwoLetters" FirstDayOfWeek="Monday" runat="server" OnDayRender="Calendar_OnDayRender" Skin="Office2007" DisabledDayStyle-ForeColor="Gray"
                                <ClientEvents OnDayRender="OnDayRender" /> 
                            </Calendar> 
                        </telerik:RadDatePicker> 
 
 
 




protected void Page_Load(object sender, EventArgs e) 
        { 
            if(!Page.IsPostBack) 
            { 
                 
            } 
            if(!IsAlreadyLoaded) 
            { 
                Raddatepicker2.Calendar.SpecialDays.Clear(); 
                Raddatepicker2.SelectedDate = DateTime.Now; 
                FullPage(); 
                FullUpdate(); 
                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 calendarSkin = Raddatepicker2.Calendar.Skin != "" ? Raddatepicker2.Calendar.Skin : "Default"; 
                string otherMonthCssClass = String.Format("otherMonth_{0}", calendarSkin); 
 
                e.Cell.Text = ""
                e.Cell.CssClass = otherMonthCssClass
 
                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); 
            } 
        } 
 

Karl
Top achievements
Rank 1
 answered on 01 Jun 2011
1 answer
104 views
Hi,
I am trying to export a RadGrid data to pdf/excel.
If I use the grid's inbuilt export button then it works fine, but if I call the ExportToExcel() from code behind it throws below exception:
Specified argument was out of the range of valid values on line- radGridShippedOrders.ExportSettings.IgnorePaging = true;

I tried to debug the code and found out that the radGridShippedOrders.MasterTableView.VirtualItemCount is returning 0.

protected void radGridShippedOrders_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{...............}

protected void btnExportToPDF_Click(object sender, EventArgs e)
        {
            radGridShippedOrders.PageSize = radGridShippedOrders.MasterTableView.VirtualItemCount;
            radGridShippedOrders.ExportSettings.IgnorePaging = true;
            radGridShippedOrders.ExportSettings.OpenInNewWindow = true;
            radGridShippedOrders.MasterTableView.ExportToPdf();
        }

<telerik:RadGrid ID="radGridShippedOrders" runat="server" GridLines="None" AllowPaging="True"
            PageSize="10" AllowSorting="True" AutoGenerateColumns="false" ShowStatusBar="true"
            HorizontalAlign="NotSet" AllowMultiRowEdit="false" OnNeedDataSource="radGridShippedOrders_NeedDataSource" 
             OnItemCommand="radGridShippedOrders_OnItemCommand"
            Width="800px" AllowMultiRowSelection="False" AllowFilteringByColumn="true" ShowGroupPanel="True">
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
            
            <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                 <Pdf PageTitle="Shipped Orders" />
            </ExportSettings>


            <MasterTableView GroupLoadMode="Client" CommandItemDisplay="Bottom" DataKeyNames="OAHSSQ" Name="MTVShippedOrders">
                <CommandItemTemplate>
                    <asp:Button ID="DownloadPDF" runat="server" CommandName="ExportToPdf" Text="Export" />
                </CommandItemTemplate>
                <CommandItemSettings ShowExportToExcelButton="true" />
                <Columns>
                    <telerik:GridBoundColumn UniqueName="OACONO" HeaderText="OACONO" DataField="OACONO">
                    </telerik:GridBoundColumn>                
                    <telerik:GridBoundColumn UniqueName="OAINNO" HeaderText="OAINNO" DataField="OAINNO">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="OAORNO" HeaderText="OAORNO" DataField="OAORNO">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="OAORGN" HeaderText="OAORGN" DataField="OAORGN">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="OAHSSQ" HeaderText="OAHSSQ" DataField="OAHSSQ">
                    </telerik:GridBoundColumn>
                </Columns>
                
                <NestedViewTemplate>
                    <b>Invoice Header</b><br />
                    <telerik:RadGrid ID="radGridInvoiceHeader" runat="server" GridLines="None" AllowPaging="True"
                        PageSize="20" AllowSorting="True" AutoGenerateColumns="false" ShowStatusBar="true"
                        HorizontalAlign="NotSet" AllowMultiRowEdit="false" OnNeedDataSource="radGridInvoiceHeader_NeedDataSource"
                        Width="100%" AllowMultiRowSelection="False" AllowFilteringByColumn="false">
                        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
                        <ExportSettings ExportOnlyData="false" IgnorePaging="true" OpenInNewWindow="true">
                            <Pdf PageTitle="Invoice Header" />
                        </ExportSettings>
                        <MasterTableView CommandItemDisplay="Bottom">
                            <CommandItemTemplate>
                                <asp:Button ID="DownloadPDF" runat="server" CommandName="ExportToPdf" Text="Export" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowExportToPdfButton="true" ExportToPdfText="Export to PDF" />
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="OHORNO" HeaderText="Order Number" DataField="OHORNO"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHCSNM" HeaderText="Customer Name" DataField="OHCSNM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHCAD1" HeaderText="Sold To Add 1" DataField="OHCAD1"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHCAD2" HeaderText="Sold To Add 2" DataField="OHCAD2"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHBLCY" HeaderText="Sold To City" DataField="OHBLCY"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHBLST" HeaderText="Sold To State" DataField="OHBLST"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHBLZP" HeaderText="Sold To Zip" DataField="OHBLZP"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSHNM" HeaderText="Customer Name 2" DataField="OHSHNM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSAD1" HeaderText="Ship To Address 1" DataField="OHSAD1"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSAD2" HeaderText="Ship To Address 2" DataField="OHSAD2"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSCTY" HeaderText="Ship To City" DataField="OHSCTY"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSHST" HeaderText="Ship To State" DataField="OHSHST"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSZIP" HeaderText="Ship To Zip" DataField="OHSZIP"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHCSPO" HeaderText="PO Number" DataField="OHCSPO"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHINAM" HeaderText="Invoice Amount" DataField="OHINAM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHISAM" HeaderText="Sub Total" DataField="OHISAM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHSCAM" HeaderText="Special Charges" DataField="OHSCAM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHTXAM" HeaderText="Sales Tax" DataField="OHTXAM"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="OHINAM" HeaderText="Order Total" DataField="OHINAM"></telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    
                    <br />
                    <b>Invoice Details</b><br />
                    <telerik:RadGrid ID="radGridInvoiceDetails" runat="server" GridLines="None" AllowPaging="True"
                        PageSize="20" AllowSorting="True" AutoGenerateColumns="false" ShowStatusBar="true"
                        HorizontalAlign="NotSet" AllowMultiRowEdit="false" OnNeedDataSource="radGridInvoiceDetails_NeedDataSource"
                        Width="100%" AllowMultiRowSelection="False" AllowFilteringByColumn="false" OnItemDataBound="radGridInvoiceDetails_ItemDataBound">
                        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
                        <ExportSettings ExportOnlyData="false" IgnorePaging="true" OpenInNewWindow="true">
                            <Pdf PageTitle="Invoice Header" />
                        </ExportSettings>
                        <MasterTableView CommandItemDisplay="Bottom">
                            <CommandItemTemplate>
                                <asp:Button ID="DownloadPDF" runat="server" CommandName="ExportToPdf" Text="Export" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowExportToPdfButton="true" ExportToPdfText="Export to PDF" />
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="ODITNO" HeaderText="Item Number" DataField="ODITNO"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODITD1" HeaderText="Item Description" DataField="ODITD1"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODQTOR" HeaderText="Quantity Ordered" DataField="ODQTOR"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODQTSH" HeaderText="Quantity Shipped" DataField="ODQTSH"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODBOQT" HeaderText="Quantity Backordered" DataField="ODBOQT"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODASLP" HeaderText="Sell Price" DataField="ODASLP"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ODLNAM" HeaderText="Extended" DataField="ODLNAM"></telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                
                </NestedViewTemplate>
                                               
            </MasterTableView>
             <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True"
                AllowColumnsReorder="True">
            </ClientSettings>
             <GroupingSettings ShowUnGroupButton="true" />
        </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 01 Jun 2011
1 answer
34 views
When I change page in RadGrid, does not fire the event "PageIndexChanged. " The EnableViewState is equal to "True. "

What could be happening?
Carlos Rdz.
Vasil
Telerik team
 answered on 01 Jun 2011
8 answers
589 views
HI,

I am using RadTabstrip in my application,inside RadTabstrip i am having tabs,my requirement is to have space between the tabs with round corners

Hiren
Top achievements
Rank 1
 answered on 01 Jun 2011
2 answers
123 views
Is there any plan to fix the display of modal windows that are larger than the browser window so they can automatically be positioned at the top left of the page instead of the middle?  When they are positioned in the middle, you have no way to get to the modal window's toolbar to drag it to where you can see it because the top of the modal window is beyond the top scroll area for the browser window.

see attached image--note that I made the browser window a bit bigger after the modal popped up so you could actually see where it is.

TechSavvySam
Top achievements
Rank 1
 answered on 01 Jun 2011
2 answers
48 views
Hi Team;

Is there any guidelines to develop ASP.Net Apps [using Telerik controls] that would run on Mobile & tables regardless of the OS?
Compared to Desktop, what are the issues that we need to take into considerations.
Thank you in advance!
..Ben
Ben Hayat
Top achievements
Rank 2
 answered on 01 Jun 2011
4 answers
201 views
Hi,

I have a treeview which want to have a background color for it. this treeview has EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="true" attributes.

<telerik:RadTreeView ID="RadTreeView1" runat="server" EnableDragAndDrop="True" OnNodeDrop="RadTreeView1_HandleDrop"
EnableDragAndDropBetweenNodes
="true"  BackColor="White"     >


treeview without BackColor work correctly but when i set BackColor then the Line which show position of Drag And Drop Between Nodes  will be disappear. the Line go to the back of BackColor.

how can i fix this problem???

Thanks
Raha
Raha
Top achievements
Rank 1
 answered on 01 Jun 2011
1 answer
708 views
I have a RadGrid with an EditForm (defined declaratively in an EditFormSettings-FormTemplate).  In that template, I set up a table with one row for each field I'm allowing the user to edit.  One of those rows needs to be selectively disabled server side from code behind.  I'm trying to do that in the ItemDataBound method.  I use the FindControl method on the GridItem passed into that method (parameter

GridItemEventArgs

 

 

e, property Item, if it's a GridEditFormItem).  If I try to find the label or textbox control that I want to disable, I can find them and set their visibility fine.  But if I try giving an Id to the Tr table row tag, or to a div that I wrap around that tag, and try FindControl with the id of those controls, item.FindControl does not find the control.  I want to disable the entire table row, not just the controls in that row.  How can I do that?

Thanks!

 

Vasil
Telerik team
 answered on 01 Jun 2011
1 answer
58 views
Hello,

We have a client that would like to give some users the ability to override stylesheets by changing colors, fonts, etc.  And other users that should not have that ability.

We are being told by our developers that the editor features are either available for all users or none.  Is this correct?

If not, how can we allow different user groups to have different access with regards to the editor?

Thanks.
Rumen
Telerik team
 answered on 01 Jun 2011
3 answers
180 views
So is there official WebParts for Telerik Silverlight controls?

If not, are there samples of wrapping something like the Grid in as a WebPart and binding SPLists?
palak
Top achievements
Rank 1
 answered on 01 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?