DateTime Group

8 posts, 0 answers
  1. Carlos Teevin
    Carlos Teevin avatar
    2 posts
    Member since:
    May 2010

    Posted 21 Jun 2010 Link to this post

    I have a column with a datetime, how i can group it by day, and not by the entire date and time?????
  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 23 Jun 2010 Link to this post

    Hello Carlos Teevin,

    There are some known issues concerning custom grouping in the current version of RadGridVew.

    You can use a work around this by adding a hidden (isVisivle = false) column and populate it with integer values corresponding to the days in the GridViewDateTimeColumn. Then you can use the GroupByExpressions CollectionChanged event to replace the grouping expression of your DateTime column with an expression for your hidden column:
    this.radGridView1.MasterGridViewTemplate.GroupByExpressions.CollectionChanged += new NotifyCollectionChangedEventHandler(GroupByExpressions_CollectionChanged);
     
    private void GroupByExpressions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    {
        int index = this.radGridView1.MasterGridViewTemplate.GroupByExpressions.IndexOf("Date");
        if (index >= 0)
        {
            this.radGridView1.MasterGridViewTemplate.GroupByExpressions.RemoveAt(index);
            this.radGridView1.MasterGridViewTemplate.GroupByExpressions.Add("[HiddenColumn] Group By [HiddenColumn]");
        }
    }

    We are working on removing the custom grouping issues for the next versions of RadGridView.

    Greetings,
    Alexander
    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Carlos Teevin
    Carlos Teevin avatar
    2 posts
    Member since:
    May 2010

    Posted 23 Jun 2010 Link to this post

    Actually i had to do it like this, because the previous code doesnt compile, im using beta q2
    radGridView1.MasterTemplate.GroupDescriptors.CollectionChanged += new Telerik.WinControls.Data.NotifyCollectionChangedEventHandler(GroupByExpressions_CollectionChanged);  
     

            void GroupByExpressions_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)  
            {  
                int index = radGridView1.MasterTemplate.GroupDescriptors.IndexOf(  
                  radGridView1.MasterTemplate.GroupDescriptors.FirstOrDefault(x => x.GroupNames.IndexOf("TransactionDate") > -1));  
                  
                if (index >= 0)  
                {  
                    radGridView1.MasterTemplate.GroupDescriptors.RemoveAt(index);  
                    radGridView1.MasterTemplate.GroupDescriptors.Insert(index,  
                        new Telerik.WinControls.Data.GroupDescriptor("Date ASC"));  
                }  
            } 

  5. Carlos Teevin
    Carlos Teevin avatar
    2 posts
    Member since:
    May 2010

    Posted 23 Jun 2010 Link to this post

    Is there anyway to apply formatstring to the group header text?
    im getting 25/10/2001 12:00 AM and i want to apply the formatstring {0:d}
  6. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 29 Jun 2010 Link to this post

    Hello Carlos Teevin,

    You can customize the group header text by using the GroupSummaryEvaluate event. For additional information, please refer to this blog article.

    RadGridView Q2 Beta has some known issues regarding GroupSummaryEvaluate event which is not fired in some cases. They will be addressed in the official Q2 2010 release due in the first half July.

    Greetings,
    Julian Benkov
    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
  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 16 Jul 2010 Link to this post

    Hi Carlos Teevin,

    I am writing to inform you that the issue that you have submitted in this ticket has been solved in Q2 2010(http://www.telerik.com/products/whats-new-winforms.aspx). Feel free to take a look at our Release Notes which will guide you through all the improvements and changes that were made in this release.

    You can download the new version from Downloads (http://www.telerik.com/account/downloads.aspx), section of your account.

    As always we will appreciate your feedback on the new release, since this is very important part of our company policies.

    If you need any assistance, do not hesitate to contact us.
     
    Sincerely yours,
    Stefan
    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
  8. Versile
    Versile avatar
    20 posts
    Member since:
    May 2009

    Posted 11 Aug 2010 Link to this post

    The blog article you posted is outdated and a good portion of the code in that blog article will not even work any longer. especially the Aggregates section.
  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 17 Aug 2010 Link to this post

    Hi Versile,

    Thank you for writing.

    Please refer to this help article. In case it does not contain the information you need, do not hesitate to write us back. We will be glad to assist you.

    Greetings,
    Stefan
    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready