We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Different behavior for two DateTime? columns

Hi, I have a sfDataGrid with two columns of date type. These columns are DateTime? and this is the XAML:

                <Syncfusion:GridDateTimeColumn MappingName="Scadenza"
                                               HeaderText="Scadenza"
                                               AllowNullValue="True"
                                               TextAlignment="Center" />
                <Syncfusion:GridDateTimeColumn MappingName="DataPagamento"
                                               HeaderText="Data pagamento"
                                               AllowNullValue="True"
                                               TextAlignment="Center" />


Why the different behavior?
I have also tried to set the "CustomPattern", but without success.

Regards

Attachment: screenshot_2680643e.rar

5 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team March 21, 2017 05:51 AM UTC

Hi Fabio, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your attached screenshot. In that, you have set the custom pattern for DateTimeColumn(Datapagamento). We are unable to reproduce the reported “DateTime column pattern are differed” issue in our end. For your reference, we have attached the sample in the below location.  
 
 
If you want to customize the DateTimeColumn, you can refer the below documentation link, 
 
 
If you are still facing the issue, could you please revert by modifying the attached sample based on your application along with the replication procedure? This would be helpful for us to provide an appropriate solution.  
 
Please let us know if you have any query. 
 
Regards, 
Muthukumar K 



FA Fabio March 21, 2017 06:06 PM UTC

Hi
I attached your example.
I added a gridtemplatecolumn e UseDrawing="Default"

Regards
Attachment: SfGrid_sampleDemo_69a3e91f.rar


MK Muthukumar Kalyanasundaram Syncfusion Team March 22, 2017 09:04 AM UTC

Hi Fabio, 
 
Thanks for the update. 
 
We have analyzed your provided sample. In that, you have used the same MappingName for more than one column. SfDataGrid process column based on mapping and we should not set same MappingName for more than one property. When you enable drawing, text drawn based on GridTemplateColumn mapping name. So we suggest you to use different mapping name for GridColumn.  
 
If you want to performance data operations (sorting, grouping) based on same mapping name for two columns, then your requirement can be achieve by setting same ValueBinding and different Mapping.  
 
Code Snippet: 
 
<syncfusion:GridTemplateColumn HeaderText="Test" MappingName="DevDate1" ValueBinding="{Binding Path=DevDate}" UseBindingValue="True"> 
    <syncfusion:GridTemplateColumn.CellTemplate> 
        <DataTemplate> 
            <Image> 
                <Image.Style> 
                    <Style TargetType="Image"> 
                        <Setter Property="Source" Value="AG00090_.GIF"/> 
                        <Style.Triggers> 
                            <DataTrigger Binding="{Binding DevDate}" Value="{x:Null}"> 
                                <Setter Property="Source" Value="AG00092_.GIF"/> 
                            </DataTrigger> 
                        </Style.Triggers> 
                    </Style> 
                </Image.Style> 
            </Image> 
        </DataTemplate> 
    </syncfusion:GridTemplateColumn.CellTemplate> 
</syncfusion:GridTemplateColumn> 
 
 
 
Please let us know if you have any query. 
 
Regards, 
Muthukumar K 
 



FA Fabio March 22, 2017 05:25 PM UTC

Thanks.

Regards


MK Muthukumar Kalyanasundaram Syncfusion Team March 23, 2017 03:40 PM UTC

Hi Fabio, 
 
You are welcome. Please let us know if you need any other assistance. 
 
Regards, 
Muthukumar K 


Loader.
Live Chat Icon For mobile
Up arrow icon