Trouble Excel-like Filtering with GridDateTimeColumn

6 posts, 0 answers
  1. Đoàn
    Đoàn avatar
    3 posts
    Member since:
    Nov 2019

    Posted 05 Nov 2019 Link to this post

    I get a trouble when using Excel-like Filtering with GridDateTimeColumn.
    It doesn't worked.
    Anyone give me an example about it. 
    Many thanks !
  2. Attila Antal
    Admin
    Attila Antal avatar
    440 posts

    Posted 08 Nov 2019 Link to this post

    Hi Đoàn,

    Based on the alert from the screenshot, I assume that RadGrid with Batch Edit mode is used, but I would need more information to be able to help.

    It would be very helpful if you could share some more details with us, such as the markup and code behind code of the Grid. This would help me understand how it is configured and allow me to give you an accurate answer.

    Kind regards,
    Attila Antal
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Đoàn
    Đoàn avatar
    3 posts
    Member since:
    Nov 2019

    Posted 10 Nov 2019 in reply to Attila Antal Link to this post

    Hi Admin Attila Antal,

    Thanks for reply me,

    Short description, I used Mode Like-excel Filtering for my Radgird. But I can not find any properties for date-ranger with Column Data is Datetime 

    This is column code

    <telerik:GridDateTimeColumn
                             DataField="date_import"
                             HeaderText="Ngày nhập"
                             AutoPostBackOnFilter="true"
                             DataType="System.DateTime"                                                
                             DataFormatString="{0:dd MMMM yyyy}"
                             AllowFiltering="true"  > 


                            <HeaderStyle Width="150px" HorizontalAlign="Center"/> 
                            <ItemStyle Width="150px" HorizontalAlign="Center" />  
                            <FooterStyle Width="150px" /> 
                        </telerik:GridDateTimeColumn> 

  4. Attila Antal
    Admin
    Attila Antal avatar
    440 posts

    Posted 13 Nov 2019 Link to this post

    Hi Đoàn,

    If this is not set in the Markup, most likely it comes from a logic in the code behind. 

    Can you try to define the MinDate and MaxDate properties in the Markup like this?

    <telerik:GridDateTimeColumn
        DataField="date_import"
        HeaderText="Ngày nhập"
        AutoPostBackOnFilter="true"
        DataType="System.DateTime"
        DataFormatString="{0:dd MMMM yyyy}"
        AllowFiltering="true"
        MinDate="01/01/1900"
        MaxDate="12/31/2050">
    
        <HeaderStyle Width="150px" HorizontalAlign="Center" />
        <ItemStyle Width="150px" HorizontalAlign="Center" />
        <FooterStyle Width="150px" />
    </telerik:GridDateTimeColumn>

     

    If that does not fix the issue, most probably some code in the server side is changing that and it sets the MinDate to be later than the MaxDate, hence the error.

    Would you mind sharing the entire RadGrid markup and code behind code that is handling it?

     

    Kind regards,
    Attila Antal
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Đoàn
    Đoàn avatar
    3 posts
    Member since:
    Nov 2019

    Posted 14 Nov 2019 in reply to Attila Antal Link to this post

    Hi Attila Antal,

    I follow your guide but it still not work. 

  6. Attila Antal
    Admin
    Attila Antal avatar
    440 posts

    Posted 15 Nov 2019 Link to this post

    Hi Đoàn,

    I am only guessing what could be the problem as I cannot see the current setup. That is why I asked for the RadGrid markup and code behind code.

    In order to be able to help, please share those details with me.

    Kind regards,
    Attila Antal
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top