Aggregate functions

11 posts, 0 answers
  1. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 30 Nov 2011 Link to this post

    Hi,
    I have a custom grid inherited from telerik radgrid. I need to display the count of rows at the bottom of the grid. I need to do this is the customgrid.cs file programatically. Any pointers on this?
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 30 Nov 2011 Link to this post

    Hi Hari,

     

    Will you clarify what do you mean by "I need to display the count of rows at the bottom of the grid"
    Do you want to embed this in the default template of your custom grid with a single element which will display the item count or maybe I am missing something? Generally you may get the number of items as shown below:

    this.customGridView.Items.Count.ToString();

    You may also define aggregates - in our online documentation you will find a detailed information on this topic, following this link. 


    Greetings,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 01 Dec 2011 Link to this post

    Hi,
    Yes, i want to embed in the default template of my grid with a single element. but how do i create an element in the class file?
  4. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 02 Dec 2011 Link to this post

    Hello Hari,

    There is  need to add another visual , to display the count. RadGridView already offers such visual - it is the column footer .

    What you need to do is to make the column footers visible and add a Count aggregate function.  Both actions you can see described in the link to the online help provided bellow.

    Regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  6. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  7. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  8. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  9. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  10. Hari
    Hari avatar
    13 posts
    Member since:
    Jun 2011

    Posted 05 Dec 2011 Link to this post

    Hi,
    I did the same and it worked. But i have a context menu for my grid. It will contain all the column names present in the grid. on checking and uncheking each value, i am making that column visible or invisble. So if i put the row count for the last column and hide it, the row count is getting hidden. Please help.
  11. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 08 Dec 2011 Link to this post

    Hi Hari,

    I am attaching a small sample. It contains a code snippet that injects a textbox in the visual tree of RadGridView. This textbox is bound to the count of the items.

    Of course the same result may be achieved in XAML - e.g. using Expression Blend , you may modify the default template of RadGridView and place the text box without code behind.

    Regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top