Cross Tab

12 posts, 0 answers
  1. Ganeshram
    Ganeshram avatar
    14 posts
    Member since:
    Feb 2008

    Posted 15 Mar 2008 Link to this post

    Support,
    I'm trying to acheive cross tab results using RadGridview.Please let me know whether this is acheivable using RadGridView.Appreciate if you can provide me a sample.

    Actual data
    Basicpay           TotalCash        Percentil
    10000                20000                10
    20000                30000                20
    30000                70000                50
    50000                80000                90

    Cross Tab Result
                            10        20        50        90
    Basic Pay        1000    2000    3000    4000
    Total Cash       3000    4000    5000    6000


    Thanks in advance.

    -Cheers
    G
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 17 Mar 2008 Link to this post

    Hi Ganeshram,

    Thank you for writing.

    Currently, the RadGridView for WinForms does not support the "CrossTab" transformation. However, you can manually do that by transforming your dataset and binding the grid to a new table. For example, please review the function provided below:

    public DataTable ConvertToCrossTab(DataTable table)  
    {  
        DataTable newTable = new DataTable();  
     
        for (int r = 0; r <= table.Rows.Count; r++)  
        {  
            newTable.Columns.Add(r.ToString());  
        }  
     
        for (int c = 0; c < table.Columns.Count; c++)  
        {  
            DataRow row = newTable.NewRow();  
            object[] rowValues = new object[table.Rows.Count + 1];  
     
            rowValues[0] = table.Columns[c].Caption;  
     
            for (int r = 1; r <= table.Rows.Count; r++)  
            {  
                rowValues[r] = table.Rows[r-1][c].ToString();     
            }  
     
            row.ItemArray = rowValues;  
            newTable.Rows.Add(row);  
        }  
     
        return newTable;  

    You should consider that the RadGridView is optimized to show a large number of rows, not columns. So if you transform table with a lot of rows (resulting in a dataset with a lot of columns) you could expect some performance decrease when showing it in a RadGridView.

    I hope this was helpful. Do not hesitate to contact me if you have other questions.

    All the best,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ganeshram
    Ganeshram avatar
    14 posts
    Member since:
    Feb 2008

    Posted 30 Mar 2008 Link to this post

    Thanks man.That helps..I'm worried abt the peformance.Can this be acheived...through telerik reports..I just bought the report packages from you.Curious this can be acheived through reports.

    I can't see any similar sample on reports.
  5. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 31 Mar 2008 Link to this post

    Hi Ganeshram,

    Thank you for getting back to me.

    Currently, Telerik Reporting does not offer pivot/cross-tabular functionality. It will be available in Q3 2008, and even earlier if our schedule permits.

    If you have any additional questions, please contact me.

    Kind regards,
    Svetoslav
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. joshuarivers
    joshuarivers avatar
    21 posts
    Member since:
    Jul 2007

    Posted 07 Jan 2009 Link to this post

    Was this feature ever completed? I don't see it documented in the Q3-08 version.
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Jan 2009 Link to this post

    Hello joshuarivers,

    Due to much needed optimization of the rendering mechanism of Telerik Reporting and other urgent tasks, the crosstab/table item functionality has been postponed for Q1 2009 and our developers are currently working on it. Q1 is scheduled for the end of February.

    Please excuse us for the inconvenience.

    Kind regards,
    Steve
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. joshuarivers
    joshuarivers avatar
    21 posts
    Member since:
    Jul 2007

    Posted 08 Jan 2009 Link to this post

    I got confused since this was the Winforms forum. Is there a plan for Crosstab on Gridview?

    I think it might be really valuable to have a generic control (a datasource?) to provide this functionality. There are a number of places where I'd find it useful to just declaratively bind to my data, but sideways. I already see a bunch of controls in your toolbox that would be better for the option.

    It's an idea.

    ps. For the other people who might search on this, some do-it-by-hand options:
    http://stackoverflow.com/questions/320895/using-linq-to-create-crosstab-results
    http://stackoverflow.com/questions/167304/is-it-possible-to-pivot-data-using-linq
  9. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 09 Jan 2009 Link to this post

    Hi joshuarivers,

    Thank you for the question.

    We do have plans to implement CrossTab functionality. Unfortunately, I cannot give you a time frame now, because we have a hard schedule and should consider including this implementation.
    Nevertheless we will very much appreciate your feedback on what would you expect from it.

    Do not hesitate to contact me again, if you have other questions.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. AM
    AM avatar
    17 posts
    Member since:
    Mar 2010

    Posted 17 Mar 2010 Link to this post

    Is this feature available in Q1 2010?
  11. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 22 Mar 2010 Link to this post

    Hello Akhila Mathews,

    Thank you for the question.

    CrossTab is not included in the latest Q1 2010 release. Before introducing this feature, we have plans to implement column virtualization in the next release Q2 2010. This will allow us to develop CrossTab in the future.

    Let me know if you have any other questions 

    Best wishes,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. Vasanth
    Vasanth avatar
    1 posts
    Member since:
    May 2012

    Posted 05 Jun 2012 Link to this post

    Hi,
        Is the feature available now? I need crosstab grid with row level and column level grouping.  Please advice, Thanks
  13. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 06 Jun 2012 Link to this post

    Hi Vasanth,

    Currently, our WinForms suite does not offer a PivotGrid. However, I am glad to inform you that we have plans to introduce such a control soon. Still, at this time I am not able to tell you in which release exactly.

    Greetings,
    Nikolay
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready