GridView paging using CommandBar

8 posts, 0 answers
  1. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 25 Feb 2011 Link to this post

    Requirements

    RadControls version 2010.3 10.1215+
    .NET version 3.5 SP1
    Visual Studio version 2008
    programming language C# and VB

    PROJECT DESCRIPTION
    This is a very basic example on how paging could be achieved using the telerik grid and the command bar.

    I know it has a lot of things and features missing, but if more people would be interested in this i will be more than happy to continue working on this.

    I have to mention that in this version i have used the grid's internal mechanism for calculating the number visible rows to calculate the maximum number of rows to be displayed.

    Please feel free to share all of your toughs and ideas :)



    Navigation:


    Sorting:
     
    Filtering:


    Best Regards,
    Emanuel Varga
    Telerik WinForms MVP
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 28 Feb 2011 Link to this post

    Hello Emanuel,

    Thank you for providing this code library project. I believe that our community will be very happy with your implementation. May be providing a VB version of this project will make it easier for the part of the community which uses Visual Basic.

    Thank you for your cooperation.
     
    Best wishes,
    Stefan
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Robybas
    Robybas avatar
    3 posts
    Member since:
    Jul 2012

    Posted 31 Jul 2012 Link to this post

    I Would use also a Data Reader, Can I??? If Yes in which way. Can you explane me. I am a new user of telerik win form.
    Regards
    Robybas
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 03 Aug 2012 Link to this post

    Hi Robybas,

    Your question does not seem directly related to this thread. If it is not, please avoid mixing different topics in the one thread and open new thread for questions that were not discussed.

    Please refer to this documentation article which demonstrates how to populate your grid from DataReader: http://www.telerik.com/help/winforms/gridview-populating-with-data-binding-to-datareader.html.

    I hope this helps.
     
    All the best,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  5. Robybas
    Robybas avatar
    3 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2012 Link to this post

    Ok thanks.
    I've another question for you.
    Could I Export all element of my radGridview?
    For useful I create a paging on my RadGridView(because the Item displayed are 19000), but when I export the data (in Csv and in Xml), the system Export me only 20 elements(the elements per page). I know is correct, but I need to export all the element.
    Could you help me:
    Follow I attach the try-catch code for the export:

     try
                {
                     //Export Per File XLS
     
                    ExportToExcelML exporterXLS = new ExportToExcelML(newGridView);
                    
                    exporterXLS.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.ExportAlways;
                    exporterXLS.ExportVisualSettings = true;
                    exporterXLS.SheetMaxRows = ExcelMaxRows._1048576;
                    exporterXLS.SheetName = "Sheet";
                    exporterXLS.SummariesExportOption = SummariesOption.DoNotExport;
                    string fileNameXLS = "ExportXLS_" + DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss");
                    exporterXLS.RunExport(fileNameXLS);
                    
                    //Export Per dati CSV
                    ExportToCSV exporterCSV = new ExportToCSV(newGridView);
     
                    exporterCSV.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.ExportAlways;
                    exporterCSV.SummariesExportOption = SummariesOption.DoNotExport;
                    string fileNameCSV = "ExportCSV_" + DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss");
                    exporterCSV.RunExport(fileNameCSV);
     
                    MessageBox.Show("Esportazione Dati Riuscita Correttamente""Avviso"MessageBoxButtons.OK); 
                }
                catch (Exception Ex)
                {
                    MessageBox.Show("Errore, Esportazione Dati Non Avvenuta, Problema Dovuto al Seguente Errore:  " + Ex.Message, "Attenzione"MessageBoxButtons.OK); 
                
                }
  6. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 14 Aug 2012 Link to this post

    Hello Robybas,

    Thank you for writing back.

    You can create a RadGridView in memory without the paging functionality, set its data source and assign it as the grid to export. This will export all the data in your data source. Here is an example:
    RadGridView grid = new RadGridView();
    grid.BindingContext = new BindingContext();       
    grid.DataSource = this.dataSource;
     
    ExportToExcelML exporter = new ExportToExcelML(grid);
    exporter.RunExport(fileName);

    I hope this will be useful. Should you have further questions, I would be glad to help.
     
    Regards,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  7. Robybas
    Robybas avatar
    3 posts
    Member since:
    Jul 2012

    Posted 14 Aug 2012 Link to this post

    Yesssss, you're great...It's Ok now!!!!
    Bye
    Robybas
  8. Tom Mieck
    Tom Mieck avatar
    11 posts
    Member since:
    Aug 2012

    Posted 31 Oct 2012 Link to this post

    Hi,
    I have one question here,
    will the filter apply on entire datasource or it will be applied only on the visible rows.
    i.e when user types "emp" in the filter it will search in the entire datasource or only the visible rows?

    regards
    tom
Back to Top