Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
hi,

I have downloaded the trial version of Telerik ASP.NET RAD Controls and I want to develop a Grid control with Export capability (pdf, excel and csv). I got a sample application from the Telerix site but it is done in WebForms and I am finding issues after issues while intergrating with an ASP.NET MVC 3.0 app (Razor).

Is there an sample application out some where on how to use the Grid in MVC applicatin with Export capability.

TIA,
Prem
Kostadin
Telerik team
 answered on 07 Nov 2012
3 answers
91 views
Hi,

I have a RadWindowManager containing some Windows. There's one that looks like a confirm dialog that I want to call a Server Side function on click.

RadWindowManager:

<telerik:RadWindowManager ID="rwManager" runat="server" Behaviors="Default" DestroyOnClose="false"
    Modal="true" RestrictionZoneID="containerBCM" VisibleStatusbar="false" IconUrl="Images/Icons/064-Information-circle-Icon16x16.png">
    <Windows>
        <telerik:RadWindow runat="server" ID="winRapport" Modal="true" InitialBehaviors="Maximize"
            EnableShadow="True">
        </telerik:RadWindow>
        <telerik:RadWindow ID="rwSub" runat="server" Behaviors="Close" Width="600px" Height="200px"
            DestroyOnClose="false" Modal="true">
        </telerik:RadWindow>
        <telerik:RadWindow ID="rwIsBilanCompleted" runat="server" Behaviors="Close" Width="310px"
            Height="120px" DestroyOnClose="false" Modal="true" Title="GESPHARxLite 2">
            <ContentTemplate>
                <div class="rwDialogPopup radconfirm">
                    <div class="rwDialogText">
                        <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
                            <%=GetMessageEx(5738).TexteHTML%>
                        </telerik:RadCodeBlock>
                    </div>
                    <div>
                        <telerik:RadButton runat="server" ID="btnIBC_Yes" Width="70px" Style="margin: 8px 8px 8px 0px; float: left;"></telerik:RadButton>
                        <telerik:RadButton runat="server" ID="btnIBC_No" Width="70px" Style="margin: 8px 8px 8px 0px; float: left;"></telerik:RadButton>
                    </div>
                </div>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I have another button (btnPrint) on my page that do a postback and set the "rwIsBilanCompleted.VisibleOnPageLoad" to true so that it shows when it refresh. So I set my RadAjaxManager like this:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents OnResponseEnd="OnResponseEnd"></ClientEvents>
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnPrint">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rwManager" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnIBC_Yes">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="lblEtatBCM" />
                <telerik:AjaxUpdatedControl ControlID="rwIsBilanCompleted" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

It works well. The problem is that when I click on btnIBC_Yes, the entire page refresh like if there was no ajax.

Did I miss something?

Thanks.
Maria Ilieva
Telerik team
 answered on 07 Nov 2012
4 answers
63 views
Hi ,
I can't retrieve the changed content of the radeditor when i have ajax on that page. i have tried the provided solutions but it doesn't work. i need a working solution.







Thanks
Dhamodharan
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
239 views
Dear Experts: 

Issue descriptions:
One of my ASP.NET MVC project uses a number of Telerik Controls and works fine, the report uses Telerik ReportViewer which is also no problem. both on my development Computer and product Server. Recently, I deployment it on my new Server, whenever go to Report Module always receive a Windows Security to ask to input Windows user and password. it doesn't work both I input Server Administration or Click cancel. 

Other Modules which not use Reportviewer are no problem, and there is not any code lead to ask Window Security in report module.
I use same way and binding same IP on IIS for previous Server(works fine) and Current Server(doesn't Work).

So, is there any chance will let the Telerik.Reportviewer to ask Windows Security certification?

This project is From authentication.

I found out by Fiddler when I go to report module will send a 401 request to server in current Server.
But do same operation on old server, the request is a 200 request.

When pop up a Windows Security Dialog while go to report Module:
Click Cancel: this is nothing to do, but redirect a empty View.

Click OK with correct user and password will receive error as below:

Server Error in '/Reports' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Reports/Report/Index/HeadOffice


Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456 

--------------------------------------------------------------------------------------------------------------------------------

The following content is got from developer Tools of IE 9.0

 The request header is as below:
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
3 401 HTTP 184.107.200.202 /Reports/Report/Index/HeadOffice 0

Of course, you can open the attach files: one is Windows Security Dialog, other one is Fiddler collection Http requests.

Here is the error log from the server:

 

Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 9/13/2012 12:54:37 PM
Event ID: 1315
Task Category: Web Event
Level: Information
Keywords: Classic
User: N/A
Computer: IW-00163E003d8c
Description:
Event code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid.
Event time: 9/13/2012 12:54:37 PM
Event time (UTC): 9/13/2012 4:54:37 PM
Event ID: ba5dc85e13f645d2810d29eb4a7477a4
Event sequence: 2
Event occurrence: 1
Event detail code: 50201

Application information:
Application domain: /LM/W3SVC/4/ROOT-1-129920288750619610
Trust level: Full
Application Virtual Path: /
Application Path: C:\Applications\VeriLoyal\
Machine name: IW-00163E003D8C

Process information:
Process ID: 3000
Process name: w3wp.exe
Account name: NT AUTHORITY\SYSTEM

Request information:
Request URL:
http://184.107.200.204/Organization/HeadOffice
Request path: /Organization/HeadOffice
User host address: 192.28.0.20
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\SYSTEM

Name to authenticate:

Custom event details:

Event Xml:
<Event xmlns="
http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="16384">1315</EventID>
<Level>4</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-09-13T16:54:37.000000000Z" />
<EventRecordID>9061</EventRecordID>
<Channel>Application</Channel>
<Computer>IW-00163E003d8c</Computer>
<Security />
</System>
<EventData>
<Data>4005</Data>
<Data>Forms authentication failed for the request. Reason: The ticket supplied was invalid.</Data>
<Data>9/13/2012 12:54:37 PM</Data>
<Data>9/13/2012 4:54:37 PM</Data>
<Data>ba5dc85e13f645d2810d29eb4a7477a4</Data>
<Data>2</Data>
<Data>1</Data>
<Data>50201</Data>
<Data>/LM/W3SVC/4/ROOT-1-129920288750619610</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>C:\Applications\VeriLoyal\</Data>
<Data>IW-00163E003D8C</Data>
<Data>
</Data>
<Data>3000</Data>
<Data>w3wp.exe</Data>
<Data>NT AUTHORITY\SYSTEM</Data>
<Data>
http://184.107.200.204/Organization/HeadOffice</Data>
<Data>/Organization/HeadOffice</Data>
<Data>192.28.0.20</Data>
<Data>
</Data>
<Data>False</Data>
<Data>
</Data>
<Data>NT AUTHORITY\SYSTEM</Data>
<Data>
</Data>
</EventData>
</Event>


Thanks.
Jason.
IvanY
Telerik team
 answered on 07 Nov 2012
6 answers
366 views
Hello Telerik Team,

I have one issue with radasyncupload control. I need to trap event when user clicks on cancel button during uploading of a file. I didn't find any onclient method which could allow this.

Do you have an idea, how to solve it ?

For further information please check the attachment of this message.

Thank you.

Vasssek
Dimitar Terziev
Telerik team
 answered on 07 Nov 2012
1 answer
77 views
I'm setting the width of my radgrid  and the scrollarea height as a percentage of the window size like so:
function GridCreated(sender, args) {
      var scrollArea = sender.GridDataDiv;
      var gridHeader = sender.GridHeaderDiv;
      scrollArea.style.height = $telerik.$(window).height() / 2 - gridHeader.clientHeight + "px";
      sender.get_element().style.width = ($telerik.$(window).height() * .85) +"px";
     
  }

I've then got  the below clientsettings
<ClientSettings>
      <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="2"/>
      <ClientEvents OnGridCreated="GridCreated" />
   </ClientSettings>

The frozen columns aren't frozen.
Yet if I set the width of the grid  as a property in the <Telerik:RadGrid tag instead of by javascript the frozen columns stay frozen as expected.
Do you have any idea why this might be happening?
Thanks
Pavlina
Telerik team
 answered on 07 Nov 2012
1 answer
77 views
Hi,

I am using radgrid asp.net control for inplace editing and to bind cascaded data from sharepoint list.

 When user clicks on any cell the cell should goes to editable mode. In editable mode there will be any
control like check box, drop down list, radio buttons, etc. and the control should get populated with sharepoint list data.
Once the value is specified next column cell should goes in editable mode and the data for that control will come from sharepoint list,
but the data will be depend on the selection of previous column cell.
 
Whatever the demo examples you have provided that uses the
SQLDataSource and AJAX.
But I want CRUD operation should happen with inplace editing.
And the data source should be Sharepoint list.

Please suggest me to interacting with radgridview with sharepoint list.

Thanks.
Tsvetoslav
Telerik team
 answered on 07 Nov 2012
2 answers
163 views
Hello,

I programmed a RadGrid with grouping and paging.

With an older version of Telerik the paging was working well with the grouping. 
Since the upgrade from the last version, if I keep the grouping, the paging doesn't work.

I use a SqlDataSource that I programme in the code behind.

This is my code :
ASPX:
<%@ Page Title="Suivi des tickets" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="SuiviTickets.aspx.cs" Inherits="Incidents_SuiviTickets" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Src="Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .left
        {
            margin-left: 30px;
        }
        .label
        {
            width: 110px;
            text-align: right;
            display: inline-block;
            font-style: italic;
            font-weight: bold;
            font-size: 1.1em;
            margin-right: 10px;
        }
        .labelTexte
        {
            display: inline-block;
        }
        .top
        {
            vertical-align: top;
        }
        .labelGauche
        {
            width: 100px;
            text-align: right;
            display: inline-block;
            vertical-align: top;
        }
        .ligne
        {
            margin: 10px;
            display: block;
        }
        .droite
        {
            float: right;
            clear: both;
            margin: 10px;
        }
        .floatLeft
        {
            float: left;
        }
        #ticket
        {
            height: 400px;
        }
        .fieldset
        {
            margin: 10px auto 0 auto;
            width: 90%;
            clear: both;
        }
        .fieldsetRecherche
        {
            margin: 10px 0;
        }
        .rechercheGauche
        {
            width: 55%;
            float: left;
        }
        .rechercheDroite
        {
            width: 40%;
            float: right;
        }
        .labelRecherche
        {
            width: 55px;
            text-align: right;
            display: inline-block;
        }
        .divEtatGauche
        {
            float: left;
        }
        .btnRechercher
        {
            float: right;
            top: 90px;
            position: relative;
        }
    </style>
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <uc1:Menu ID="Menu1" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="ralpIncident">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgTickets">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="phGrid" />
                    <telerik:AjaxUpdatedControl ControlID="rgTickets" />
                    <telerik:AjaxUpdatedControl ControlID="phRecherche" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnValider">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="phGrid" />
                    <telerik:AjaxUpdatedControl ControlID="rgTickets" />
                    <telerik:AjaxUpdatedControl ControlID="phRecherche" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnAnnuler">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="phGrid" />
                    <telerik:AjaxUpdatedControl ControlID="rgTickets" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRechercher">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="phGrid" />
                    <telerik:AjaxUpdatedControl ControlID="rgTickets" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="ralpIncident" runat="server" />
    <telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server" LoadingPanelID="ralpIncident">
        <asp:PlaceHolder ID="phRecherche" runat="server">
            <fieldset class="fieldsetRecherche">
                <legend> Recherche </legend>
                <div class="rechercheGauche">
                    <span class="ligne">
                        <asp:TextBox ID="tbRecherche" runat="server" Width="447px"></asp:TextBox>
                        <ajax:TextBoxWatermarkExtender ID="tweRecherche" TargetControlID="tbRecherche" runat="server"
                            WatermarkText="Titre, description, demandeur(uid), n° ticket, ...">
                        </ajax:TextBoxWatermarkExtender>
                    </span><span class="ligne">
                        <asp:Label ID="lbAffecteA" Text="Affecté à" runat="server" class="labelRecherche"></asp:Label>
                        <telerik:RadComboBox ID="rcbAffecte" runat="server" DataTextField="prenomNom" DataSourceID="odsDSI"
                            DataValueField="ID" Height="100%" AppendDataBoundItems="true" Width="180px" DropDownWidth="180px"
                            CssClass="left">
                            <Items>
                                <telerik:RadComboBoxItem Value="0" runat="server" />
                            </Items>
                        </telerik:RadComboBox>
                    </span><span class="ligne">
                        <asp:Label ID="lbDate" Text="Date" runat="server" class="labelRecherche"></asp:Label>
                        <telerik:RadComboBox ID="rcbTypeDate" runat="server" Height="100%" AppendDataBoundItems="true"
                            Width="85px" DropDownWidth="85px" CssClass="left">
                            <Items>
                                <telerik:RadComboBoxItem Value="0" runat="server" />
                                <telerik:RadComboBoxItem Text="Création" Value="1" runat="server" />
                                <telerik:RadComboBoxItem Text="Affectation" Value="2" runat="server" />
                                <telerik:RadComboBoxItem Text="Traitement" Value="3" runat="server" />
                            </Items>
                        </telerik:RadComboBox>
                          entre  
                        <telerik:RadDatePicker ID="rdpDebut" runat="server" Width="100px">
                        </telerik:RadDatePicker>
                         et 
                        <telerik:RadDatePicker ID="rdpFin" runat="server" Width="100px">
                        </telerik:RadDatePicker>
                    </span>
                </div>
                <div class="rechercheDroite">
                    <asp:Label ID="lbRechercheEtat" Text="Etat" runat="server" class="labelRecherche floatLeft"></asp:Label>
                    <asp:CheckBoxList ID="cblEtat" CssClass="left floatLeft" DataSourceID="sdsEtats"
                        runat="server" OnDataBound="cblEtat_DataBound" DataTextField="libelle" DataValueField="idEtat"
                        RepeatColumns="1" RepeatDirection="Vertical">
                    </asp:CheckBoxList>
                    <asp:Button ID="btnRechercher" runat="server" Text="Rechercher" class="btnRechercher"
                        OnClick="btnRechercher_Click" />
                </div>
            </fieldset>
        </asp:PlaceHolder>
        <asp:PlaceHolder ID="phGrid" runat="server" Visible="true">
        <telerik:RadScriptBlock ID="rsbScript" runat="server">
            <script type="text/javascript">
                function showToolTip(element, idTicket) {
                    var tooltipManager = $find("<%= rtmTicket.ClientID %>");
 
                    // Si l'utilisateur survole la celulle avant que la page est chargée, il n'ya pas de gestionnaire créé
                    if (!tooltipManager) return;
 
                    //  Trouver l'info-bulle pour cet élément si elle a été créée
                    var tooltip = tooltipManager.getToolTipByElement(element);
 
                    //Create a tooltip if no tooltip exists for such element
                    if (!tooltip) {
                     tooltip = tooltipManager.createToolTip(element);
 
                     tooltip.set_value(idTicket);
                    }
 
                    // Créer une info-bulle si aucune info-bulle existe pour cet élément
                    element.onmouseover = null;
 
                    // afficher l'info-bulle
                    setTimeout(function() {
                     tooltip.show();
                    }, 10);
                }
 
            </script>
        </telerik:RadScriptBlock>  
            <telerik:RadToolTipManager ID="rtmTicket" runat="server" Position="MiddleLeft"
                HideEvent="LeaveTargetAndToolTip" Animation="Fade" RelativeTo="Mouse" Width="500px" AutoCloseDelay="0"
                IgnoreAltAttribute="true" >
            <WebServiceSettings Path="../WebServices/TooltipTickets.asmx" Method="GetToolTipData" />
        </telerik:RadToolTipManager>
            <telerik:RadGrid ID="rgTickets" runat="server" AutoGenerateColumns="false" DataSourceID="sdsTickets"
                ShowGroupPanel="True" OnItemCommand="rgTickets_ItemCommand"
                AllowPaging="true"  PageSize="25"
                OnPageIndexChanged="rgTickets_PageIndexChanged" OnPageSizeChanged="rgTickets_PageSizeChanged"
                AllowAutomaticDeletes="true" 
                AllowSorting="true" OnSortCommand="rgTickets_SortCommand"
                OnGroupsChanging="RgTickets_GroupsChanging"
                AllowFilteringByColumn="True"
                OnDeleteCommand="rgTickets_DeleteCommand" OnItemDataBound="rgTickets_ItemDataBound">
                <MasterTableView DataSourceID="sdsTickets" DataKeyNames="idTicket" GroupLoadMode="Server"
                    AllowMultiColumnSorting="true" AllowCustomSorting="true" AllowFilteringByColumn="true" >
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression >
                         
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="Etat" />
                                <telerik:GridGroupByField FieldName="nbTickets" HeaderText="Nb tickets" Aggregate="Count" />
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="idEtat" FieldAlias="Etats" SortOrder="Ascending" />
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="idTicket" DataField="idTicket" HeaderText="Num Ticket"
                            HeaderStyle-Width="20px" ItemStyle-Width="20px" FilterControlWidth="20px" AutoPostBackOnFilter="false"
                            CurrentFilterFunction="equalto" FilterDelay="1000" ShowFilterIcon="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="demandeur" DataField="demandeur" HeaderText="Demandeur"
                            ItemStyle-Wrap="true" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="dateDemande" DataField="dateDemandeFormate"
                            HeaderText="Date demande" HeaderStyle-Width="80px" ItemStyle-Width="80px" DataFormatString="{0:dd/MM/yyyy}"
                            DataType="System.DateTime" FilterControlWidth="80px" AutoPostBackOnFilter="false"
                            CurrentFilterFunction="StartsWith" FilterDelay="1000" ShowFilterIcon="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="titre" DataField="titre" HeaderText="Titre"
                            ItemStyle-Wrap="true " AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn ShowFilterIcon="false" AllowFiltering="false" HeaderText="Description" UniqueName="description"
                            HeaderStyle-Width="120px">
                            <ItemTemplate>
                                <asp:Label ID="rgLbDescription" runat="server" Text='<%# Eval("descriptionCourte") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn UniqueName="IdAffecteA" DataField="IdAffecteA" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="affecteA" DataField="affecteA" HeaderText="Affecté à"
                            ItemStyle-Width="100px" ShowFilterIcon="false" AutoPostBackOnFilter="false">
                            <FilterTemplate>
                                <telerik:RadComboBox ID="rcbAffecteA" DataTextField="prenomNom" DataSourceID="odsDSI"
                                    DataValueField="ID" Height="100%" AppendDataBoundItems="true" Width="120px" DropDownWidth="200px"
                                    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("IdAffecteA").CurrentFilterValue %>'
                                    runat="server" OnClientSelectedIndexChanged="rcbAffecteA_ClientSelectedIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
 
                                    <script type="text/javascript">
                                        function rcbAffecteA_ClientSelectedIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("IdAffecteA", args.get_item().get_value(), "EqualTo");
                                        
                                    </script>
 
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="dateAffectation" DataField="dateAffectation"
                            HeaderText="Date affectation" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="80px"
                            ItemStyle-Width="80px" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="dateTraitement" DataField="dateTraitement" HeaderText="Date traitement"
                            HeaderStyle-Width="80px" ItemStyle-Width="80px" DataFormatString="{0:dd/MM/yyyy}"
                            DataType="System.DateTime" FilterControlWidth="80px" AutoPostBackOnFilter="false"
                            CurrentFilterFunction="StartsWith" FilterDelay="1000" ShowFilterIcon="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="IdEtat" DataField="IdEtat" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="etat" DataField="etat" HeaderText="Etat" ShowFilterIcon="false"
                            AutoPostBackOnFilter="false" Display="true">
                            <FilterTemplate>
                                <telerik:RadComboBox ID="rcbEtatTic" DataTextField="libelle" DataSourceID="sdsEtats"
                                    DataValueField="IdEtat" Height="100%" AppendDataBoundItems="true" Width="50px"
                                    DropDownWidth="80px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("IdEtat").CurrentFilterValue %>'
                                    runat="server" OnClientSelectedIndexChanged="rcbEtatTic_ClientSelectedIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
 
                                    <script type="text/javascript">
                                        function rcbEtatTic_ClientSelectedIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("IdEtat", args.get_item().get_value(), "EqualTo");
                                        
                                    </script>
 
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn UniqueName="Editer" AllowFiltering="false" >
                            <ItemTemplate>
                                <a href="GestionTicket.aspx?ticket=<%# Eval("idTicket") %>" target="_blank">
                                    <img src="../Images/edit.gif" />
                                </a>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn ConfirmText="Annuler le ticket ?" ConfirmDialogType="Classic"
                            ConfirmTitle="Annuler" ButtonType="ImageButton" CommandName="Delete" Text="Annuler"
                            ImageUrl="../Images/cancel.gif" UniqueName="DeleteColumn" ItemStyle-Width="20px">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="true">
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
                <PagerStyle Mode="NextPrevAndNumeric" PageSizeLabelText="Par page :" PagerTextFormat="{5} ligne(s) dans {1}"
                    FirstPageToolTip="Première page" LastPageToolTip="Dernière page" NextPageToolTip="Page suivante"
                    PrevPageToolTip="Page précédente" PageButtonCount="15" AlwaysVisible="true" Position="TopAndBottom" />
            </telerik:RadGrid>
        </asp:PlaceHolder>
    </telerik:RadAjaxPanel>
    <asp:SqlDataSource ID="sdsTickets" runat="server" ConnectionString="<%$ ConnectionStrings:Intranet %>"
        ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" DeleteCommand="UPDATE INT_Tickets SET idEtat=5 WHERE idTicket=?idTicket">
        <UpdateParameters>
            <asp:Parameter Name="idTicket" Type="Int32"></asp:Parameter>
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsEtats" runat="server" ConnectionString="<%$ ConnectionStrings:Intranet %>"
        ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" SelectCommand="SELECT * FROM INT_TicketsEtats ">
    </asp:SqlDataSource>
    <asp:ObjectDataSource ID="odsDSI" runat="server" SelectMethod="DSI" TypeName="AnnuaireEmployes">
    </asp:ObjectDataSource>
</asp:Content>

CS:
using System;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
 
 
using Telerik.Web.UI;
 
public partial class Incidents_SuiviTickets : PageBase
{
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        Menu1.Demandeur(Contexte.Utilisateur.UID);
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
 
            if (Contexte.Droits.Contains("DSI"))
            {
                rcbAffecte.DataBind();
                rcbAffecte.SelectedValue = Contexte.Utilisateur.ID.ToString();
 
                cblEtat.DataBind();
                // on sélectionne la cb nouveau
                cblEtat.Items[0].Selected = true;
                // on sélectionne la cb pris en charge
                cblEtat.Items[1].Selected = true;
            }
            Bind();
        }
 
    }
 
    protected void cblEtat_DataBound(object sender, EventArgs e)
    {
        if (Contexte.Droits.Contains("DSI"))
        {
            //rcbAffecte.DataBind();
            // on sélectionne l'id de l'utilisatuer (DSI) connecté
            rcbAffecte.SelectedValue = Contexte.Utilisateur.ID.ToString();
            // on sélectionne la cb nouveau
            cblEtat.Items[0].Selected = true;
            // on sélectionne la cb pris en charge
            cblEtat.Items[1].Selected = true;
        }
    }
 
    protected void Bind()
    {
        // Supprimer les paramètres existants
        sdsTickets.SelectParameters.Clear();
 
        // Récupérer les infos des tickets avec libellé
        var requeteInfos = new StringBuilder();
        requeteInfos.Append("SELECT idTicket, uidDemandeur, demandeur, mailDemandeur, DATE_FORMAT(dateDemande, '%d/%m/%Y') as dateDemandeFormate, dateDemande, idAffecteA, affecteA, dateAffectation, DATE_FORMAT(dateTraitement, '%d/%m/%Y') as dateTraitement, titre, REPLACE(description, '\n', '<br/>') as description, if(LENGTH(description) > 15, CONCAT(SUBSTRING(description, 1, 15), '...'), SUBSTRING(description, 1, 15)) as descriptionCourte, e.idEtat, e.libelle as etat, (SELECT COUNT(*) FROM INT_Tickets) as nbTickets ");
        requeteInfos.AppendLine("FROM intranet.INT_Tickets t ");
        requeteInfos.AppendLine("LEFT JOIN INT_TicketsEtats e ON e.idEtat=t.idEtat ");
 
        // Afficher les tickets de l'utilisateur connecté sauf s'il fait pati de la DSI
        var where = new StringBuilder();
        if (!Contexte.Droits.Contains("DSI"))
        {
            phRecherche.Visible = false;
            where.AppendLine(string.Format(" WHERE uidDemandeur=?uidDemandeur ", Utilisateur.UID));
            sdsTickets.SelectParameters.Add("uidDemandeur", Utilisateur.UID);
            requeteInfos.AppendLine(where.ToString());
        }
        else
        {
            phRecherche.Visible = true;
 
            #region Recherche
            var filtre = new StringBuilder();
 
            // Filtre sur le n° ticket, titre, descriptino demandeur
            if (!string.IsNullOrEmpty(tbRecherche.Text))
            {
                filtre.Append(" ((idTicket=?idTicket ");
                filtre.Append(" OR titre LIKE ?text OR description LIKE ?text OR demandeur LIKE ?text) ");
                sdsTickets.SelectParameters.Add("idTicket", tbRecherche.Text);
                sdsTickets.SelectParameters.Add("text", string.Format("%{0}%", tbRecherche.Text));
            }
            // Filtre sur AffecteA
            if (Convert.ToInt32(rcbAffecte.SelectedValue) > 0)
            {
                if (!string.IsNullOrEmpty(filtre.ToString()))
                    filtre.Append(" AND idAffecteA=?idAffecteA ");
                else
                    filtre.Append(" (idAffecteA=?idAffecteA ");
 
                sdsTickets.SelectParameters.Add("idAffecteA", rcbAffecte.SelectedValue);
            }
            // Filtre par date
            if (Convert.ToInt32(rcbTypeDate.SelectedValue) > 0 && (rdpDebut.SelectedDate.HasValue || rdpFin.SelectedDate.HasValue))
            {
                switch (rcbTypeDate.SelectedItem.Text)
                {
                    case "Création":
                        if (!string.IsNullOrEmpty(filtre.ToString()))
                            filtre.Append(string.Format(" AND (DATE(dateDemande) BETWEEN ?debutDem AND ?finDem) "));
                        else
                            filtre.Append(string.Format(" ((DATE(dateDemande) BETWEEN ?debutDem AND ?finDem) "));
 
                        sdsTickets.SelectParameters.Add("debutDem", !rdpDebut.SelectedDate.HasValue ? rdpDebut.MinDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpDebut.MinDate.ToString("yyyy-MM-dd"));
                        sdsTickets.SelectParameters.Add("finDem", !rdpFin.SelectedDate.HasValue ? rdpFin.MaxDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpFin.MaxDate.ToString("yyyy-MM-dd"));
 
                        break;
                    case "Affectation":
                        if (!string.IsNullOrEmpty(filtre.ToString()))
                            filtre.Append(string.Format(" AND (DATE(dateAffectation) BETWEEN ?debutAff AND ?finAff) "));
                        else
                            filtre.Append(string.Format(" ((DATE(dateAffectation) BETWEEN ?debutAff AND ?finAff) "));
 
                        sdsTickets.SelectParameters.Add("debutDem", !rdpDebut.SelectedDate.HasValue ? rdpDebut.MinDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpDebut.MinDate.ToString("yyyy-MM-dd"));
                        sdsTickets.SelectParameters.Add("finDem", !rdpFin.SelectedDate.HasValue ? rdpFin.MaxDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpFin.MaxDate.ToString("yyyy-MM-dd"));
 
                        break;
                    case "Traitement":
                        if (!string.IsNullOrEmpty(filtre.ToString()))
                            filtre.Append(string.Format(" AND (DATE(dateTraitement) BETWEEN ?debutTra AND ?finTra) "));
                        else
                            filtre.Append(string.Format(" ((DATE(dateTraitement) BETWEEN ?debutTra AND ?finTra) "));
 
                        sdsTickets.SelectParameters.Add("debutDem", !rdpDebut.SelectedDate.HasValue ? rdpDebut.MinDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpDebut.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpDebut.MinDate.ToString("yyyy-MM-dd"));
                        sdsTickets.SelectParameters.Add("finDem", !rdpFin.SelectedDate.HasValue ? rdpFin.MaxDate.ToString("yyyy-MM-dd") : !string.IsNullOrEmpty(rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd")) ? rdpFin.SelectedDate.Value.ToString("yyyy-MM-dd") : rdpFin.MaxDate.ToString("yyyy-MM-dd"));
 
                        break;
                    default:
                        break;
                }
            }
 
            // Filtre sur les états
            var listeEtats = new StringBuilder();
            var filtreEtats = new StringBuilder();
            var nouveau = string.Empty;
            foreach (ListItem item in cblEtat.Items)
            {
                if (item.Selected && !item.Value.Equals("1"))
                {
                    listeEtats.Append(item.Value + ",");
                }
 
                if (item.Selected && item.Value.Equals("1"))
                {
                    nouveau = item.Value;
                }
            }
            if (listeEtats.ToString().EndsWith(","))
                listeEtats = listeEtats.Remove(listeEtats.Length - 1, 1);
 
            if (!string.IsNullOrEmpty(listeEtats.ToString()))
            {
                var etats = listeEtats.ToString().Split(',');
                if (!string.IsNullOrEmpty(filtre.ToString()))
                    filtreEtats.Append(" AND (");
                else
                    filtreEtats.Append(" (");
 
                foreach (var etat in etats)
                {
                    filtreEtats.Append(string.Format(" t.idEtat=?etat{0} OR ", etat));
                    sdsTickets.SelectParameters.Add(string.Format("etat{0}", etat), etat);
                }
                var fEtat = filtreEtats.ToString();
 
                if (fEtat.EndsWith(" OR "))
                {
                    fEtat = fEtat.Remove(fEtat.Length - (" OR ".Length), " OR ".Length);
                }
 
                if (!string.IsNullOrEmpty(filtre.ToString()))
                    filtre.Append(fEtat + ")");
                else
                    filtre.Append(fEtat);
            }
            #endregion
 
            if (string.IsNullOrEmpty(where.ToString()) && !string.IsNullOrEmpty(filtre.ToString()))
                where.Append(" WHERE ");
            if (!string.IsNullOrEmpty(filtre.ToString()))
            {
                requeteInfos.AppendLine(where.ToString());
                requeteInfos.Append(filtre.ToString());
                requeteInfos.Append(") ");
            }
            else
            {
                requeteInfos.AppendLine(where.ToString());
            }
            if (!string.IsNullOrEmpty(nouveau))
            {
                if (!string.IsNullOrEmpty(filtre.ToString()))
                {
                    requeteInfos.Append(" OR t.idEtat = ?idEtat ");
                }
                else
                {
                    if (string.IsNullOrEmpty(where.ToString()))
                    {
                        where.Append(" WHERE ");
                    }
                    else
                    {
                        where.Append(" AND ");
                    }
 
                    requeteInfos.Append(where + " t.idEtat = ?idEtat ");
                }
                sdsTickets.SelectParameters.Add("idEtat", nouveau);
            }
        }
 
        requeteInfos.Append(" ORDER BY t.idEtat asc, dateDemande desc");
 
        sdsTickets.SelectCommand = requeteInfos.ToString();
        sdsTickets.DataBind();
    }
 
    protected void rgTickets_PageIndexChanged(object sender, GridPageChangedEventArgs e)
    {
        Bind();
    }
 
    protected void rgTickets_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
    {
        Bind();
    }
 
    protected void rgTickets_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.NextPageCommandArgument || e.CommandName == RadGrid.PrevPageCommandArgument ||
            e.CommandName == RadGrid.FirstPageCommandArgument || e.CommandName == RadGrid.LastPageCommandArgument ||
            e.CommandName == RadGrid.PageCommandName || e.CommandName == RadGrid.SortCommandName ||
            e.CommandName == RadGrid.FilterCommandName )
        {
            Bind();
        }
    }
 
    protected void RgTickets_GroupsChanging(object sender, GridGroupsChangingEventArgs e)
    {
        Bind();
    }
 
    protected void rgTickets_SortCommand(object sender, GridSortCommandEventArgs e)
    {
        Bind();
    }
 
    protected void btnRechercher_Click(object sender, EventArgs e)
    {
        Bind();
    }
 
    protected void rgTickets_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            var item = e.Item as GridDataItem;
            if (!Contexte.Droits.Contains("DSI") && (string.IsNullOrEmpty(item["AffecteA"].Text) || item["AffecteA"].Text.Equals(" ")) && item["etat"].Text.Equals("Nouveau"))
            {
                item["DeleteColumn"].Visible = true;
            }
            else
                item["DeleteColumn"].Visible = false;
 
 
            var idTicket = item["idTicket"].Text.ToString();
            item["description"].Attributes["onmouseover"] = string.Format("showToolTip(this,{0});", idTicket);
        }
    }
 
    protected void rgTickets_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        Bind();
    }
 
    protected bool GetDeleteVisible(int idEtat)
    {
        if (!Contexte.Droits.Contains("DSI"))
            return true;
 
        return false;
    }
 
    protected bool GetVisible()
    {
        if (!Contexte.Droits.Contains("DSI"))
            return false;
 
        return true;
    }
 
    public bool GetSuppression(int idUtilisateur)
    {
        if (idUtilisateur == Utilisateur.ID)
            return true;
 
        return false;
    }
 
    private class Message
    {
        public int IdMessage { get; set; }
        public string Texte { get; set; }
        public DateTime DateMessage { get; set; }
        public string Utilisateur { get; set; }
        public int IdUtilisateur { get; set; }
    }
}

Thank you for your answer,

Cordially,

Simon
Simon
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
52 views
Hi,

I have tried my utmost to get my radgrid to fill a 100% div area which is fitted to the page height with no luck at all.

Could someone please let me know how to get the grid to fit the page or parent div height and also adjust as the page is resized.

Much Thanks!
Pavlina
Telerik team
 answered on 07 Nov 2012
9 answers
249 views
Hi , Can any one help me, i'm using RadDatePicker in this , i blocking some special days. special days blocking are working fine if i change the month from july to august its working fine . if i again change to august to july code blocking is there but images for that special days are not working. I'm also using autopostback="true".  Here my code
    <telerik:RadCodeBlock ID="myCodeBlock" runat="server">
        <script type="text/javascript">
            //<![CDATA[
            function rdpDay_OnDateSelected(sender, e) {
                var myId = document.getElementById("<%= ddlTime.ClientID %>");
                if (myId != null) {
                    myId.style.display = "none";
                }
                document.getElementById("<%= hfHideValue.ClientID %>").value = "Hidden";
            }
 
            // 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]);
                var jsDate = new Date(args._date[0], args._date[1] - 1, args._date[2]);
                var disabledDays = document.getElementById("ctl00_cphMaster_hdDisableWeek").value;
                var mySplitResult = disabledDays.split(",");
                for (i = 0; i < mySplitResult.length; i++) {
                    if (jsDate.getDay() == parseInt(mySplitResult[i])) {
                        var otherMonthCssClass = "ColorGray";
                        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 = "";
                        break;
                    }
                }
 
                var blockedDays = document.getElementById("ctl00_cphMaster_hdBlockDays").value;
                var mySplitBlockDaysResult = blockedDays.split(",");
                for (i = 0; i < mySplitBlockDaysResult.length; i++) {
                    var d = new Date(mySplitBlockDaysResult[i]);
                    if (jsDate.toString() == d.toString()) {
                        var otherMonthCssClass = "ColorRed";
                        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 = "";
                        break;
                    }
                }
            }
            //]]>
        </script>
    </telerik:RadCodeBlock>
 
<telerik:RadDatePicker ID="rdpDay" AutoPostBack="true" runat="server" CssClass="txtStyl" Width="120px"
                                                            Skin="Office2007">
                                                            <DateInput ID="DateInput1" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"
                                                                FocusedStyle-CssClass="txtStyl" EnabledStyle-CssClass="txtStyl" HoveredStyle-CssClass="txtStyl"
                                                                EmptyMessage="dd/mm/yyyy" ForeColor="#666666" Font-Names="Arial,Helvetica,sans-serif"
                                                                HideOnBlur="True" runat="server" ReadOnly="true" Style="font-size: 11pt; width: 75px;">
                                                            </DateInput>
                                                            <Calendar OnDayRender="Calendar_OnDayRender" AutoPostBack="true" runat="server" Skin="Office2007">
                                                                <ClientEvents OnDayRender="OnDayRender" />
                                                            </Calendar>
                                                            <ClientEvents OnDateSelected="rdpDay_OnDateSelected" />
                                                        </telerik:RadDatePicker>
protected void Calendar_OnDayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        if (enableWeek == null)
        {
            if (ViewState["enableWeek"] != null)
                enableWeek = (StringBuilder)ViewState["enableWeek"];
        }
 
        if (myBlockDays == string.Empty)
        {
            if (ViewState["myBlockDays"] != null)
                myBlockDays = ViewState["myBlockDays"].ToString();
        }
 
        if (enableWeek != null)
        {
            string[] iEnableWeek = enableWeek.ToString().Split(',');
 
            string[] iDisableWeek = new string[7] { "0", "1", "2", "3", "4", "5", "6" };
 
            for (int i = 0; i < iDisableWeek.Length; i++)
            {
                for (int j = 0; j < iEnableWeek.Length; j++)
                {
                    if (iEnableWeek[j].Trim() == iDisableWeek[i])
                    {
                        iDisableWeek[i] = "";
                        break;
                    }
                }
            }
 
            for (int i = 0; i < iDisableWeek.Length; i++)
            {
                if (iDisableWeek[i] != "")
                {
                    // modify the cell rendered content for the days we want to be disabled (e.g. every Saturday and Sunday)
                    if (e.Day.Date.DayOfWeek == (DayOfWeek)Convert.ToInt32(iDisableWeek[i]))
                    {
                        // if you are using the skin bundled as a webresource("Default"), the Skin property returns empty string
                        string otherMonthCssClass = "ColorGray";
 
                        // clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
                        e.Cell.Controls.Clear();
                        e.Cell.Text = "";
                        e.Cell.Enabled = false;
                        e.Cell.CssClass = otherMonthCssClass; //set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
 
                        // render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
                        Label label = new Label();
                        label.Text = e.Day.Date.Day.ToString();
                        e.Cell.Controls.Add(label);
 
                        // disable the selection for the specific day
                        RadCalendarDay calendarDay = new RadCalendarDay();
                        calendarDay.Date = e.Day.Date;
                        calendarDay.IsSelectable = false;
                        calendarDay.ItemStyle.CssClass = otherMonthCssClass;
                        rdpDay.Calendar.SpecialDays.Add(calendarDay);
                        break;
                    }
                }
            }
 
            string[] iBlockDays = myBlockDays.ToString().Split(',');
            for (int i = 0; i < iBlockDays.Length; i++)
            {
                if (iBlockDays[i].Trim() != "")
                {
                    if (e.Day.Date == Convert.ToDateTime(iBlockDays[i].Trim()))
                    {
                        // if you are using the skin bundled as a webresource("Default"), the Skin property returns empty string
                        string otherMonthCssClass = "ColorRed";
 
                        // clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
                        e.Cell.Text = "";
                        e.Cell.CssClass = otherMonthCssClass; //set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
 
                        // render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
                        Label label = new Label();
                        label.Text = e.Day.Date.Day.ToString();
                        e.Cell.Controls.Add(label);
 
                        // disable the selection for the specific day
                        RadCalendarDay calendarDay = new RadCalendarDay();
                        calendarDay.Date = e.Day.Date;
                        calendarDay.IsSelectable = false;
                        calendarDay.ItemStyle.CssClass = otherMonthCssClass;
                        rdpDay.Calendar.SpecialDays.Add(calendarDay);
                        break;
                    }
                }
            }
        }
    }
Vasil
Telerik team
 answered on 07 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?