This is a migrated thread and some comments may be shown as answers.

rad gridview

7 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Troika
Top achievements
Rank 1
Troika asked on 20 Feb 2013, 12:23 PM
http://www.telerik.com/registration-

i'm using telerik gridview like here http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx but in that demo when filter data it shows a loding with blue background in my case it reloads my page everytime i filter it, maybe because i'm getting the data from different tables into the rad gridview?

i have enabled ajax so why it reloads? is there a way to not refresh the page like that

by the way how to activate pdf export?
choose default id panel is empty , why? i'm using metro skin

also how can i edit some fields only when we are at edit template i dont see the textboxes in designtime...

also filter options are not getting translates nor filter when we set culture why?

7 Answers, 1 is accepted

Sort by
0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 20 Feb 2013, 04:07 PM
Hi Troika,

I'm unsure why the filter language is not getting translated along with your other text. Did you make sure to put your RadGrid inside of a RadAjaxPanel? It is an important part of making sure that there is an AJAX callback as opposed to a postback on the page.

Hopefully this helps,
Master Chief
0
Troika
Top achievements
Rank 1
answered on 21 Feb 2013, 12:47 PM
here is the code in want when user clicks on filter in loads a loading panel like here when you search you see the ... http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx
also i have edit mode enabled but in edit templates instead of textboxes i want labels , and leave the checkmark but when i enter edit template cant find them to replace

my code:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager runat="server">
    </telerik:RadAjaxManager>
    <br />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="Metro" AnimationDuration="5000" HorizontalAlign="Center" InitialDelayTime="5000">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="sql_ds_listarUsers" GridLines="None" Skin="Metro">
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataSourceID="sql_ds_listarUsers">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter UserName column" HeaderText="UserName" SortExpression="UserName" UniqueName="UserName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RoleName" FilterControlAltText="Filter RoleName column" HeaderText="RoleName" SortExpression="RoleName" UniqueName="RoleName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastActivityDate" DataType="System.DateTime" FilterControlAltText="Filter LastActivityDate column" HeaderText="LastActivityDate" SortExpression="LastActivityDate" UniqueName="LastActivityDate">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="IsApproved" DataType="System.Boolean" FilterControlAltText="Filter IsApproved column" HeaderText="IsApproved" SortExpression="IsApproved" UniqueName="IsApproved">
        </telerik:GridCheckBoxColumn>
        <telerik:GridCheckBoxColumn DataField="IsLockedOut" DataType="System.Boolean" FilterControlAltText="Filter IsLockedOut column" HeaderText="IsLockedOut" SortExpression="IsLockedOut" UniqueName="IsLockedOut">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="CreateDate" DataType="System.DateTime" FilterControlAltText="Filter CreateDate column" HeaderText="CreateDate" SortExpression="CreateDate" UniqueName="CreateDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastLoginDate" DataType="System.DateTime" FilterControlAltText="Filter LastLoginDate column" HeaderText="LastLoginDate" SortExpression="LastLoginDate" UniqueName="LastLoginDate">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>
0
Eyup
Telerik team
answered on 25 Feb 2013, 09:29 AM
Hi Troika,

You can use RadAjaxLoadingPanel together with RadAjaxManager or RadAjaxPanel and fully customize its appearance to achieve the desired behavior:
 LoadingPanel Demo
 LoadingPanel OverView

You can also check out various demos to get a practical idea of its implementation.

As for altering the edit mode controls, you can use ItemCreated or ItemDataBound server events as to access the generated controls:
( Section Accessing controls in edit/insert mode )
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

This example demonstrates how to distinguish edit and insert forms:
http://www.telerik.com/help/aspnet-ajax/grid-distinguish-edit-insert-mode-on-itemcreated-itemdatabound.html

You can get general information about the differences between the two events in this article:
http://www.telerik.com/help/aspnet-ajax/listview-differences-between-itemcreated-itemdatabound-events.html

For an example of PDF exporting, please refer to this demo and its related topic:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx

In order to localize the grid, you will need to use a resource file .resx to apply a global localization to your RadGrid:
 http://www.telerik.com/help/aspnet-ajax/grid-localization-global-resources.html
You could use one of the files provided in the following code library:
http://www.telerik.com/community/code-library/aspnet-ajax/localization/global-resources-for-radgrid.aspx

And here is an actual example:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/localization/defaultcs.aspx

Hope these guides will help.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Troika
Top achievements
Rank 1
answered on 02 Mar 2013, 10:26 AM
but howv to use it the loading panel when we change gridview page:

<%@ Page Title="" Language="C#" MasterPageFile="~/admin_template/MP/Admin.Master" AutoEventWireup="true" CodeBehind="GerirLogin.aspx.cs" Inherits="NovaOnda2013.admin_template.GerirLogin" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderColEsq" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderColDir" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <br />
    <br />
 
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableHistory="True" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
 
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" GridLines="None" OnDataBinding="RadGrid1_DataBinding" Skin="Metro">
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
<MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
    <br />
    <br />
</asp:Content>


i put this code but it dont display the loading like here in the second grid: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

i'm doing this on codebehind:
public partial class GerirLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             
            RadGrid1.DataBind();
            
        }
 
       
 
        protected void RadGrid1_DataBinding(object sender, EventArgs e)
        {
            RadGrid1.DataSource= Membership.GetAllUsers();
 
        }
 
        
    }


also if you could do this working exemple with loading panel  pdf export like here http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx
0
Shinu
Top achievements
Rank 2
answered on 04 Mar 2013, 06:32 AM
Hi,

Please make sure that you are using advanced data binding using its NeedDataSource event when using features in grid like paging, sorting etc. Check the following help documentation which explains more about this.
Advanced Data-binding (using NeedDataSource event)

Thanks,
Shinu
0
Troika
Top achievements
Rank 1
answered on 04 Mar 2013, 07:15 PM
now its other gridview with selecting feature on click but this is reloading my page when i select a item and page gets to top.... so i want to select it but do not refresh like that here is the code:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None" Skin="Metro" PageSize="5" DataSourceID="SqlDataSource1">
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="True" Selecting-AllowRowSelect="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="nome" FilterControlAltText="Filter nome column" HeaderText="nome" SortExpression="nome" UniqueName="nome">
<ColumnValidationSettings>
<ModelErrorMessage Text=""></ModelErrorMessage>
</ColumnValidationSettings>
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="id" FilterControlAltText="Filter id column" HeaderText="id" SortExpression="id" UniqueName="id" DataType="System.Int32" ReadOnly="True">
<ColumnValidationSettings>
<ModelErrorMessage Text=""></ModelErrorMessage>
</ColumnValidationSettings>
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox" AlwaysVisible="True"></PagerStyle>
</MasterTableView>
 
<PagerStyle PageSizeControlType="RadComboBox" AlwaysVisible="True"></PagerStyle>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>
0
Eyup
Telerik team
answered on 07 Mar 2013, 01:16 PM
Hello Troika,

I suppose you have a DefaultButton set to your form. In that case, please check out the following thread for using the DefaultFocus property:
http://www.telerik.com/community/forums/aspnet-ajax/ajax/usage-of-defaultbutton-logic-is-resulting-in-moving-to-the-top-of-the-page-on-other-control-clicks.aspx

Hope this helps.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Troika
Top achievements
Rank 1
Answers by
MasterChiefMasterChef
Top achievements
Rank 2
Troika
Top achievements
Rank 1
Eyup
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or