Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Hi, there is a way to repeat the time row every 10, 20 resoures? or repeat it in the bottom of the scheduler?
It's very important to see the time and if i have 30 resources i have to scroll up till the top of the page.


Thanks 
Mattia
Plamen
Telerik team
 answered on 05 Dec 2013
2 answers
149 views
I've read the information at http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html and I'm now trying to let the child RadWindow 'talk' back to its parent RadWindow.

When the user presses OK in the child window, a function in the parent RadWindow should be called, passing one or more arguments.

I've tried using 'opener' in the child RadWindow to reference the parent RadWindow, but it is undefined.

I've tried explicitly specifying a parent property the following way:
function OpenChildRadWindow(p_sURL, p_iWidth, p_iHeight) {
    var l_oBrowserWnd = GetRadWindow().BrowserWindow;
    setTimeout(function () {
        var l_oWindow = l_oBrowserWnd.radopen(p_sURL, "newRadWindow", p_iWidth, p_iHeight);
        l_oWindow.radParent = this;
        l_oWindow.InitialBehaviors = Telerik.Web.UI.WindowBehaviors.None;
        l_oWindow.set_modal(true);
    }, 0);
}
But when I try to reference "window.radParent" in the child RadWindow it is also undefined.

How can I let a parent and child RadWindow communicate with each other?

Marja
Top achievements
Rank 1
 answered on 05 Dec 2013
5 answers
253 views
Hello everyone, I have one problem with RadComboBox and will appreciate any help. I'm using 2013.1.403.40 version with v4.0.30319 runtime in my ASP.NET application. So, here is my solution: combobox on the page, that is populated from server side.
<telerik:radcombobox id="cmbBox" runat="server" width="185px"
DataTextField="Text" DataValueField="Value" DataCheckedField="IsChecked" MaxHeight="185px"
CheckBoxes="True" EnableCheckAllItemsCheckBox="True" Filter="None" Sort="None" EnableTextSelection="False" OnClientItemChecked="cmbBoxItemChecked"/>
cmbBox.Items.Add(new RadComboBoxItem("separator1") { IsSeparator = true });
cmbBox.Items.Add(new RadComboBoxItem
                    {  Text = "Name1",   Value = "Value1",  Checked = false });
cmbBox.Items.Add(new RadComboBoxItem("separator2") { IsSeparator = true });
cmbBox.Items.Add(new RadComboBoxItem
                    {  Text = "Name2",   Value = "Value2",  Checked = false });
cmbBox.Items.Add(new RadComboBoxItem("separator3") { IsSeparator = true });
cmbBox.Items.Add(new RadComboBoxItem
                    {  Text = "Name3",   Value = "Value3",  Checked = false });
So, 6 items will appear on client side (3 separators and 3 simple items). I've also attached event handler for OnClientItemChecked with folowing logic:

function cmbBoxItemChecked(sender, eventArgs)
{
   sender.set_text("my custom text according to internal logic, based on checked item");
}
And here is my problem: for example, before sender.set_text operation, text was "2 items checked". Right after sender.set_text it will change to "my custom..." (as desired).
But after exiting from event handler, text will return to it's previous state ("2 items checked"). It seems, that another event fires right after 
OnClientItemChecked.
So my desired behaviour, is to change text in radcombobox after user was (un)checked random item. It is possible, or by now, this is not achievable ? 
Thank you in advance.

Nencho
Telerik team
 answered on 05 Dec 2013
1 answer
130 views
I'm having an issue with my RadTreeList where the HeaderText on the Excel spreadsheet isn't showing after exporting. I don't know if there is some kind of conflict somewhere upstream that's preventing this from happening. I don't think it has to do with AJAX because the rest of the spreadsheet shows everything correctly. 

Any tips are greatly appreciated.
Kostadin
Telerik team
 answered on 05 Dec 2013
9 answers
2.1K+ views

Good day,

We’ve been experiencing the invalid webresource exception for at least a few weeks now, mainly on IE7 and IE8, although we’ve also seen it on IE9 and Firefox (but far less frequently). 

2012-06-06 14:10:23,238 [20] [admin] [xbqai0wdtzjrg2akwu0hjrc1] [(null)] ERROR Global - Unhandled exception was [System.Web.HttpException (0x80004005): This is an invalid webresource request.

2012-06-06 16:11:49,758 [17] [(null)] [(null)] [(null)] ERROR Global - Application_Error : unhandled exception processing /[AppName]/WebResource.axd?d=Suu-bg3mCuf0dFdR6OaZkvX4qIzt-FMOe6pPRuU-iok0iBRX7G8SkmhJ6f6sVdRz5vgh3rhLmGeuyVCZQ7NlYAkluB8OomTcba5DZz_nqarySe1LWUgUVAdCHlVY9NrY1NCgWnu8yVgPuJfiygFy-Q2&t=634739782657507859


We fixed this by using fixed Machine Keys in IIS, and once all the users had deleted their Temporary Internet Files, we did not see the exception again. At least, until we deployed the latest build of our code onto the server.

Now, the issue is recurring fairly randomly and what happens is on certain pages our application, the selected menu item disappears as do the background images for RadTabStrips. What’s interesting is that it only happens on Internet Explorer (even 9), and if we open Developer Tools and check “Always refresh from server” under Cache, the problem goes away, but returns as soon as we uncheck that option.

We then went to our Temporary Internet Files folder and noticed that there are a number of files with names like: Telerik.Web.UI.WebResource.axd?compress=x&Telerik.Web.UI%2c+Version%3d2012.1.215.40%2c+Culture%3dneutral%2c …

We then opened all of these into Notepad and took the each of the problematic URLs in the error log to try and find the culprit, but to no avail.

We do have the following code on our Master page (if that helps):

<telerik:RadScriptManager ID="RadScriptManager" runat="server" EnableScriptGlobalization="true" EnablePageMethods="true" EnableScriptCombine="true">

<CompositeScript>

                    <Scripts>

                        <asp:ScriptReference Path="~/Javascript/jquery1.js" />

                        <asp:ScriptReference Path="~/Javascript/JavaScript1.js" />

                    </Scripts>

       </CompositeScript>

       </telerik:RadScriptManager>

 

 

We are unable to provide a sample of the issue, as we can’t reproduce it locally (other than with automatically generated keys).

Any advice you can provide would be greatly appreciated.

 

Kind regards,

Graeme

 

Kate
Telerik team
 answered on 05 Dec 2013
1 answer
68 views
Hi,

I have a telerik:treeview control which is not visible in High Contrast Mode.

I am wondering if you have any accessible skin file which could be visible in High Contrast Mode.

It is mentioned in telerik api document that it could be added your own customized skin file.

I am wondering if you could send me original css file which i could modify based on it.
e.g.
.RadTreeView_Default .rtPlus, .RadTreeView_Default .rtMinus {
    background-image: url("WebResource.axd?d=wgTjU3KiWAo_0FDbJwGr6RFpcMX3-7_5KbAkWx40lH2Qq9j8ViE26F3XYE0b1Jxom0PcBCS-33pqzkWvZWq0fqjFEDn97IbIyd-2QqpbYnV9mtFtLYvUT7F58EMwwpoMjbAFsfKmzjTBipk-bByPXzvYSF41&t=635168307340000000");
}

I could change to my own image.

Thanks
Regards
Yuzhuo
Ivan Zhekov
Telerik team
 answered on 05 Dec 2013
10 answers
259 views
I have a self-referencing hierarchical grid with five columns:  Id, Title, Body, Created By and Created On.  Each row has these five properties.

Users can hide any of the columns using the built in Header Context Menu functionality.  When I choose to hide a column, the column header is removed, as are any corresponding values from the master table.  However, all of the child values in the hierarchical detail tables still have the column showing.

For example, if I have the following (where col# = column, p# = parent and c# = child)...

col 1 | col 2 | col 3 | col 4
p1    | p2    | p3    | p4   |
c1    | c2    | c3    | c4   |
c1    | c2    | c3    | c4   |

...and I decide to hid col 4 via the header context menu, I end up with something like the following:

col 1 | col 2 | col 3 |
p1    | p2    | p3    |
c1  | c2  | c3  | c4  |
c1  | c2  | c3  | c4  |

What do I need to set in order for the Header Context Menu to also hide detail table columns?

Here's my grid definition:

<telerik:RadGrid
    ID="grdNotes"
    runat="server"
    OnColumnCreated="grdNotes_ColumnCreated"
    OnItemCreated="grdNotes_ItemCreated"
    OnItemDataBound="grdNotes_ItemDataBound"
    OnNeedDataSource="grdNotes_NeedDataSource"
    OnPreRender="grdNotes_PreRender"
    AutoGenerateColumns="false"
    SkinID="HierarchicalGrid"
    GridLines="None"
    AllowCustomPaging="True"
    ShowStatusBar="True"
    PageSize="20"
    EnableLinqExpressions="False"
    Width="99%">
    <MasterTableView
        HierarchyDefaultExpanded="true"
        HierarchyLoadMode="Client"
        AllowSorting="true"
        DataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator"
        ClientDataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator"
        NoDetailRecordsText=""
        EnableNoRecordsTemplate="False"
        TableLayout="Auto"
        Width="100%"
        HorizontalAlign="Right">
         
        <SelfHierarchySettings ParentKeyName="ParentId" KeyName="Id" MaximumDepth="20" />
 
        <RowIndicatorColumn Visible="False" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
        <Columns>
            <telerik:GridClientSelectColumn DataTextField="Id" HeaderAbbr="Select" HeaderButtonType="TextButton"
                HeaderText="Select" HeaderTooltip="Select/Deselect" Text="Select" Visible="false"
                UniqueName="asgSelect" Exportable="false">
            </telerik:GridClientSelectColumn>
            <telerik:GridBoundColumn DataField="Id" SortExpression="Id" UniqueName="Id" Exportable="true">
                <HeaderStyle Width="50px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Title" SortExpression="Title" UniqueName="Title" Exportable="true"
                HtmlEncode="true" >
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Body" SortExpression="Body" UniqueName="Body" HtmlEncode="False" Exportable="true">
                <HeaderStyle Width="350px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CreatedBy" SortExpression="CreatedBy" UniqueName="CreatedBy" Exportable="true">
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CreatedDate" SortExpression="CreatedDate" UniqueName="CreatedOn" Exportable="true">
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ParentId" HeaderText="Parent Id" SortExpression="ParentId" Exportable="false"
                UniqueName="ParentId" Visible="false" />
            <telerik:GridBoundColumn DataField="Token" HeaderText="Token" SortExpression="Token" Exportable="false"
                UniqueName="Token" Visible="false" />
            <telerik:GridBoundColumn DataField="IsRoot" HeaderText="Is Root" SortExpression="IsRoot" Exportable="false"
                UniqueName="IsRoot" Visible="false" />
            <telerik:GridBoundColumn DataField="Replies" HeaderText="Replies" SortExpression="Replies" Exportable="false"
                UniqueName="Replies" Visible="false" />
            <telerik:GridBoundColumn DataField="NoteCreator" HeaderText="NoteCreator" SortExpression="NoteCreator" Exportable="false"
                UniqueName="NoteCreator" Visible="false" />
            <telerik:GridTemplateColumn UniqueName="Actions" Visible="false" Exportable="false">
                <ItemTemplate>
                    <telerik:RadToolBar ID="rtbNoteActions" runat="server" SkinID="ActionToolbar" OnButtonClick="NotesGridToolbarButtonClicked"
                        OnClientButtonClicking="NoteActionToolbarClicking">
                        <Items>
                            <telerik:RadToolBarButton Text="Properties" CommandName="Properties" ImageUrl="~/Images/page_view.gif" />
                            <telerik:RadToolBarButton Text="Reply" CommandName="Reply" ImageUrl="~/Images/page_edit.gif" />
                            <telerik:RadToolBarButton Text="Security" CommandName="Security" ImageUrl="~/Images/shield16.gif" />
                            <telerik:RadToolBarButton Text="Delete" CommandName="Delete" ImageUrl="~/Images/delete16.gif" />
                        </Items>
                    </telerik:RadToolBar>
                </ItemTemplate>
                <HeaderStyle Width="15%"></HeaderStyle>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
 
        <PagerStyle AlwaysVisible="True"></PagerStyle>
    </MasterTableView>
    <HeaderContextMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </HeaderContextMenu>
    <ExportSettings ExportOnlyData="True" IgnorePaging="True">
    </ExportSettings>
    <ClientSettings Selecting-AllowRowSelect="true" Resizing-AllowColumnResize="true">
        <Selecting AllowRowSelect="True"></Selecting>
        <ClientEvents
            OnRowSelected="NoteRowSelected"
            OnRowContextMenu="NoteContextMenu"
            OnRowDblClick="grdNotes_OnRowDblClick"
            OnGridCreated="NotePageLoad"
            OnTableCreated="ResizeAllNoteColumns"
            OnColumnResized="ResizeAllNoteColumns" />
        <Resizing AllowColumnResize="True"></Resizing>
    </ClientSettings>
    <PagerStyle Position="Bottom" AlwaysVisible="True" Mode="NextPrevAndNumeric" Wrap="False"
        BackColor="White" Font-Size="Large" />
</telerik:RadGrid>
Kostadin
Telerik team
 answered on 05 Dec 2013
6 answers
408 views
When I click  on the filter present on the header area of grid, its coming beside the column which is correct. But when trying to access this through enter key by putting focus with the help of tab key, the placement is not coming beside the column. Its different in different browsers.
Thanks in advance for any kind of help on this issue.
Eyup
Telerik team
 answered on 05 Dec 2013
3 answers
122 views
Hello good people,

I'm having a problem with a ajaxfied grid on ASP.NET, I'm able to populate the grid first time on Page Load (without ajax), and then again using the form to filter the records displayed on page (this WITH ajax), the grid IS populated, but then all controls on page stops responding.

Target framework .net 4.5

Any advice will help.

Code is posted here below.

Thanks in advance!

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DashboardContabilidade.aspx.cs" Inherits="GaragemMaintenance.DashboardContabilidade" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>--%>
 
<!DOCTYPE html>
<head id="Head1" runat="server">
<title>Dashboard Estapar</title>
<script src="Scripts/jquery-2.0.3.js"></script>
<%--<script src="Scripts/jquery-ui-1.10.3.js"></script>--%>
<%--<link href="Content/themes/base/jquery-ui.css"  rel="stylesheet" type="text/css"/>--%>
<%--<link type="text/css" rel="stylesheet" href="Content/themes/css/style.css" />--%>
<%--<link rel='stylesheet' type='text/css' href='Styles/StaticHeader.css' />--%>
<style>
.hidden
{
    display: none;
}
 
body
{
    /*background: #FFF;
    color: #000;*/
    font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
    /*margin: 10px;*/
    padding: 0;
}
 
td
{
    font: normal normal 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
}
 
th
{
    font: normal normal 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
}
 
.ImageButtons
{
    padding-top: 5px;
    padding-right: 5px;
}
</style>
<script>
function onRequestStart(sender, args) {
    if (args.get_eventTarget().indexOf("Export") >= 0) {
        args.set_enableAjax(false);
    }
}
</script>
</head>
<body>
<form id="form1" runat="server" style="background-color: white;">
    <input id="scrollPos" runat="server" type="hidden" value="0" />
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
            <Services>
                <asp:ServiceReference Path="DataManager.svc" />
            </Services>
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <ClientEvents OnRequestStart="onRequestStart" />
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="radGrdContabil_GridHeader">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlGrid" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="radGrdContabil">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="radGrdContabil" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnFiltrar">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlMain" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnExportExcel">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnExportExcel" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnExportPdf">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnExportPdf" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnExportWord">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnExportWord" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnExportCsv">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnExportCsv" LoadingPanelID="loadingPanel"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="loadingPanel" runat="server" Height="75px" Width="75px" Transparency="25">
            <img alt="Carregando..." style="border:0;" src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' />
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" Skin="Office2010Silver" EnableRoundedCorners="true" />
        <telerik:RadNotification ID="radNotification" runat="server" EnableRoundedCorners="true" EnableShadow="true" Position="Center" Title="Aviso" Width="400" Height="150"
            Text="A execução desta consulta sem filtro retorna mais linhas do que o ERP consegue exportar, por favor selecione algum outro filtro.">
        </telerik:RadNotification>
        <telerik:RadNotification ID="radNotificationData" runat="server" EnableRoundedCorners="true" Position="Center" Title="Aviso" Width="400" Height="150"
            EnableShadow="true" Text="A execução desta consulta exige ao menos um filtro de data.">
        </telerik:RadNotification>
        <div>
            <asp:Label ID="Label1" runat="server" Text="DashBoard Contabilidade" Font-Bold="True" Font-Size="20pt"></asp:Label>
        </div>
        <telerik:RadAjaxPanel runat="server" ID="pnlMain">
            <div>
                <table style="width: 1100px">
                    <tr>
                        <td>
                            <table class="" style="width: 700px">
                                <tr>
                                    <td colspan="5">
                                        <p></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label ID="Label5" runat="server" Text="Datas:"></asp:Label>
                                    </td>
                                    <td rowspan="8">
                                        <table style="width: 150px; position: relative">
                                            <tr>
                                                <td style="width: 50px">
                                                    <asp:ImageButton runat="server" ID="btnExportExcel" OnClick="btnExportExcel_Click" CssClass="ImageButtons" ImageUrl="~/Images/file-extension-xls-html-icon.png" />
                                                </td>
                                                <td style="width: 50px">
                                                    <asp:ImageButton runat="server" ID="btnExportPdf" OnClick="btnExportPdf_Click" CssClass="ImageButtons" ImageUrl="~/Images/file-extension-pdf-icon.png" />
                                                </td>
                                                <td style="width: 50px">
                                                    <asp:ImageButton runat="server" ID="btnExportWord" OnClick="btnExportWord_Click" CssClass="ImageButtons" ImageUrl="~/Images/file-extension-doc-icon.png" />
                                                </td>
                                                <td style="width: 50px">
                                                    <asp:ImageButton runat="server" ID="btnExportCsv" OnClick="btnExportCsv_Click" CssClass="ImageButtons" ImageUrl="~/Images/file-extension-csv-icon.png" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label4" runat="server" Text="Mês De:"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadMonthYearPicker ID="mesDe" runat="server" Culture="pt-BR" DateInput-Culture="pt-BR" DateInput-DateFormat="MM/yyyy"
                                            Skin="Office2010Silver" MonthYearNavigationSettings-TodayButtonCaption="Hoje" Width="95px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="Label6" runat="server" Text="Mês Até:"></asp:Label></td>
                                    <td>
                                        <telerik:RadMonthYearPicker ID="mesAte" runat="server" Culture="pt-BR" DateInput-Culture="pt-BR" DateInput-DateFormat="MM/yyyy"
                                            Skin="Office2010Silver" MonthYearNavigationSettings-TodayButtonCaption="Hoje" Width="95px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label ID="Label9" runat="server" Text="Contas:"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label7" runat="server" Text="De:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlContasDe" runat="server" Font-Size="9px" Font-Names="Verdana" DataTextField="Descricao" DataValueField="CT1_CONTA" Width="300px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="Label8" runat="server" Text="Até:"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="ddlContasAte" runat="server" Font-Size="9px" Font-Names="Verdana" DataTextField="Descricao" DataValueField="CT1_CONTA" Width="300px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Label ID="Label13" runat="server" Text="Centro de Custo:"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label12" runat="server" Text="De:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCentrosDe" runat="server" Font-Size="9px" Font-Names="Verdana" DataTextField="Descricao" DataValueField="CTT_CUSTO" Width="300px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="Label2" runat="server" Text="Até:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCentrosAte" runat="server" Font-Size="9px" Font-Names="Verdana" DataTextField="Descricao" DataValueField="CTT_CUSTO" Width="300px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 50px"></td>
                                    <td>
                                        <asp:Button ID="btnFiltrar" runat="server" Text="Filtrar" OnClick="btnFiltrar_Click" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnLimpar" runat="server" Text="Limpar" OnClick="btnLimpar_Click" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnMenu" runat="server" Text="Menu" OnClick="btnMenu_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <p></p>
                <telerik:RadGrid ID="radGrdContabil" runat="server" Skin="Office2010Blue" Width="95%" Height="500px" AutoGenerateColumns="True" CellSpacing="0"
                    GridLines="None" AllowPaging="true" ShowHeader="true" Style="margin-left: 20px" ShowStatusBar="true" StatusBarSettings-LoadingText="Carregando"
                    PageSize="200" OnSortCommand="radGrdContabil_SortCommand" OnPageIndexChanged="radGrdContabil_PageIndexChanged"
                    OnPageSizeChanged="radGrdContabil_PageSizeChanged">
                    <ClientSettings>
                        <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                    </ClientSettings>
                    <MasterTableView AutoGenerateColumns="True" EnableColumnsViewState="false" AllowSorting="true">
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                        <NoRecordsTemplate>
                            <div>Não existem registros para os filtros selecionados!</div>
                        </NoRecordsTemplate>
                    </MasterTableView>
                </telerik:RadGrid>
            </div>
        </telerik:RadAjaxPanel>
    </div>
</form>
</body>
</html>

And the CS File

using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
/* adicionar o namespace para o .NET carregar o método extendido AuthRedirect */
using Estapar.Security;
using Estapar.Security.Web;
 
namespace GaragemMaintenance
{
    public partial class DashboardContabilidade : EstaparPage
    {
        public bool rebind = false;
        private const string sessionDataID = "ContabilData";
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                mesDe.SelectedDate = DateTime.Now;
                mesAte.SelectedDate = DateTime.Now;
 
                ddlContasDe.DataSource = DAO.GetContasCorrentes();
                ddlContasDe.DataBind();
                ddlContasDe.Items.Insert(0, new ListItem("Selecione...", ""));
 
                ddlContasAte.DataSource = DAO.GetContasCorrentes();
                ddlContasAte.DataBind();
                ddlContasAte.Items.Insert(0, new ListItem("Selecione...", ""));
 
                ddlCentrosDe.DataSource = DAO.GetCentroCustos();
                ddlCentrosDe.DataBind();
                ddlCentrosDe.Items.Insert(0, new ListItem("Selecione...", ""));
 
                ddlCentrosAte.DataSource = DAO.GetCentroCustos();
                ddlCentrosAte.DataBind();
                ddlCentrosAte.Items.Insert(0, new ListItem("Selecione...", ""));
 
                FillGrid(false);
            }
        }
 
        private void FillGrid(bool useCache)
        {
            DataTable res = new DataTable();
 
            try
            {
                if (!useCache || Session[sessionDataID] == null)
                {
                    res = DAO.GetDashboardDataContabilCC(mesDe.SelectedDate.Value, mesAte.SelectedDate.Value, ddlContasDe.SelectedValue, ddlContasAte.SelectedValue, ddlCentrosDe.SelectedValue, ddlCentrosAte.SelectedValue);
                    Session[sessionDataID] = res;
                }
                else
                {
                    res = (DataTable)Session[sessionDataID];
                }
 
                radGrdContabil.DataSource = res;
                radGrdContabil.ColumnCreated += radGrdContabil_ColumnCreated;
                radGrdContabil.DataBind();
            }
            catch (Exception Ex)
            {
                radNotification.Show(Ex.Message);
            }
        }
 
        private bool NenhumaData()
        {
            return ((!mesDe.SelectedDate.HasValue) && (!mesAte.SelectedDate.HasValue));
        }
 
        protected void btnFiltrar_Click(object sender, EventArgs e)
        {
            radNotification.Visible = false;
            if (NenhumaData())
            {
                radNotificationData.Show();
                return;
            }
 
            FillGrid(false);
        }
 
        void radGrdContabil_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            var col = e.Column;
 
            if (col.UniqueName == "ExpandColumn")
                e.Column.Visible = false;
 
            if (col.UniqueName == "CONTA")
            {
                col.HeaderStyle.Width = new Unit("60px");
                col.HeaderText = "Conta";
            }
            else if (col.UniqueName == "DESC_CONTA")
            {
                col.HeaderStyle.Width = new Unit("250px");
                col.HeaderText = "Nome Conta";
            }
            else if (col.UniqueName == "CENTRO_CUSTO")
            {
                col.HeaderStyle.Width = new Unit("60px");
                col.HeaderText = "Centro";
            }
            else if (col.UniqueName == "DESC_CC")
            {
                col.HeaderStyle.Width = new Unit("250px");
                col.HeaderText = "Nome Centro";
            }
            else if (col.UniqueName == "TOTAL")
            {
                col.HeaderStyle.Width = new Unit("60px");
                col.HeaderText = "Total";
            }
            else if (col.UniqueName.StartsWith("M"))
            {
                col.HeaderStyle.Width = new Unit("60px");
                col.HeaderText = col.UniqueName.Remove(0, 1).Insert(4, "-");
            }
        }
 
        protected void btnLimpar_Click(object sender, EventArgs e)
        {
            mesDe.SelectedDate = DateTime.Now;
            mesAte.SelectedDate = DateTime.Now;
            ddlContasDe.SelectedIndex = 0;
            ddlContasAte.SelectedIndex = 0;
            ddlCentrosDe.SelectedIndex = 0;
            ddlCentrosAte.SelectedIndex = 0;
        }
 
        private RadGrid PrepareGridToExport()
        {
            rebind = true;
            FillGrid(true);
 
            RadGrid gv = radGrdContabil;
 
            gv.ExportSettings.OpenInNewWindow = true;
            gv.ExportSettings.UseItemStyles = true;
            gv.ExportSettings.ExportOnlyData = true;
            gv.ExportSettings.FileName = "ControleContabil";
            gv.ExportSettings.IgnorePaging = true;
            gv.MasterTableView.AllowPaging = false;              
 
            return gv;
        }
 
        protected void btnExportExcel_Click(object sender, ImageClickEventArgs e)
        {
            RadGrid gv = PrepareGridToExport();
 
            if (gv != null)
            {
                gv.ExportSettings.Excel.Format = GridExcelExportFormat.Biff;
                gv.MasterTableView.ExportToExcel();
            }
        }
 
        protected void btnExportPdf_Click(object sender, ImageClickEventArgs e)
        {
            RadGrid gv = PrepareGridToExport();
            if (gv != null)
            {        
                gv.ExportSettings.Pdf.FontType = Telerik.Web.Apoc.Render.Pdf.FontType.Subset;
                gv.ExportSettings.Pdf.PaperSize = GridPaperSize.Letter;
                gv.ExportSettings.Pdf.PageHeight = Unit.Parse("210mm");
                gv.ExportSettings.Pdf.PageWidth = Unit.Parse("397mm");
                gv.ExportSettings.Pdf.Title = "DashBoard";
                
                gv.MasterTableView.ExportToPdf();
            }
        }
 
        protected void btnExportWord_Click(object sender, ImageClickEventArgs e)
        {
            RadGrid gv = PrepareGridToExport();
             
            if (gv != null)
                gv.MasterTableView.ExportToWord();
        }
 
        protected void btnExportCsv_Click(object sender, ImageClickEventArgs e)
        {
            RadGrid gv = PrepareGridToExport();
             
            if (gv != null)
                gv.MasterTableView.ExportToCSV();
        }
 
        protected void radGrdContabil_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            radGrdContabil.CurrentPageIndex = e.NewPageIndex;
            FillGrid(true);
        }
 
        protected void radGrdContabil_SortCommand(object sender, GridSortCommandEventArgs e)
        {
            //radGrdContabil.MasterTableView.SortExpressions.Add(e.NewSortOrder);
            FillGrid(true);
        }
 
        protected void radGrdContabil_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
        {
            //radGrdContabil.PageSize = e.NewPageSize;
            FillGrid(true);
        }
 
        protected void btnMenu_Click(object sender, EventArgs e)
        {
            Response.AuthRedirect("Menu.aspx", this.UsuarioLogado.UserName);
        }
    }
}
Eyup
Telerik team
 answered on 05 Dec 2013
3 answers
115 views
Is it not possible to have multiple spaces in between words when calling set_text()?
Kate
Telerik team
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?