This is a migrated thread and some comments may be shown as answers.

Trouble Excel-like Filtering with GridDateTimeColumn

5 Answers 254 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Đoàn
Top achievements
Rank 1
Đoàn asked on 06 Nov 2019, 04:09 AM
I get a trouble when using Excel-like Filtering with GridDateTimeColumn.
It doesn't worked.
Anyone give me an example about it. 
Many thanks !

5 Answers, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 08 Nov 2019, 04:39 PM

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.
0
Đoàn
Top achievements
Rank 1
answered on 11 Nov 2019, 04:22 AM

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> 

0
Attila Antal
Telerik team
answered on 13 Nov 2019, 07:35 PM

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.
0
Đoàn
Top achievements
Rank 1
answered on 15 Nov 2019, 03:33 AM

Hi Attila Antal,

I follow your guide but it still not work. 

0
Attila Antal
Telerik team
answered on 15 Nov 2019, 08:30 AM

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.
Tags
Grid
Asked by
Đoàn
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Đoàn
Top achievements
Rank 1
Share this question
or