Hello
I have a read only column with dates in my XamGrid. Is there any way to use a DateColumn (with all the benefits like Filters) and show the date as text, without the DatePicker ?
Alternately can I use a different column type and use the dates filters on it ?
thank you!
Hello Lukasz,
Thank you for your post!
I have been looking into your issue. What I can suggest is to take a look at the following forum thread, where similar issue is discussed: http://ko.infragistics.com/community/forums/t/83842.aspx.
Please do not hesitate to let me know if you have any further questions on this matter.
Thank you!
I think I have done something similar:
<ig:TemplateColumn Key="end_date" IsFilterable="True" HeaderText="End Date" IsReadOnly ="True" > <ig:TemplateColumn.FilterColumnSettings> <ig:FilterColumnSettings > <ig:FilterColumnSettings.RowFilterOperands > <ig:EqualsOperand/> <ig:DateTimeAfterFilterOperand/> <ig:DateTimeBeforeFilterOperand/> <ig:DateTimeTodayFilterOperand/> <ig:DateTimeTomorrowFilterOperand/> <ig:DateTimeYesterdayFilterOperand/> </ig:FilterColumnSettings.RowFilterOperands> </ig:FilterColumnSettings> </ig:TemplateColumn.FilterColumnSettings> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=end_date}" VerticalAlignment="Center" Margin="5,0,0,0" /> </StackPanel> </DataTemplate> </ig:TemplateColumn.ItemTemplate> <ig:TemplateColumn.FilterEditorTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding Value.end_date, Mode=OneWay}"/> </DataTemplate> </ig:TemplateColumn.FilterEditorTemplate> <ig:TemplateColumn.FilterItemTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding Value.end_date, Mode=OneWay}"/> </DataTemplate> </ig:TemplateColumn.FilterItemTemplate> </ig:TemplateColumn>
It almost does the job with exception to the filtering parameter. The selected date does not applies to
<ig:EqualsOperand/> <ig:DateTimeAfterFilterOperand/> <ig:DateTimeBeforeFilterOperand/>
operands.
Thank you,
Lukas
Hello Lukas,
I have been looking into your latest post and it seems that I am missing something from your scenario. Would you please provide me with more detailed information on what do you mean under " The selected date does not applies to
<ig:EqualsOperand/>
<ig:DateTimeAfterFilterOperand/>
<ig:DateTimeBeforeFilterOperand/>
operands."?
Looking forward to hearing from you.
Thank you for looking into this.
"Selected Date" refers to the date selected as the filter parameter. When I select DateTimeTodayFilterOperand filtering works fine. When I select DateTimeAfterFilterOperand and pick a date from a control the filtering is not working.
I have been looking into the code snippet, that you have provided.
If you would like to not show the DatePicker in the cell of the XamGrid, but you want it to be present in the filter I can suggest setting the EditorDisplayBehavior property of the DateColumn to "EditMode". Here is an example:
<ig:DateColumn Key="Date"
IsFilterable="True"
EditorDisplayBehavior="EditMode"
IsReadOnly="True"
/ >
Editors (and the button of the DatePicker) would be visible only when the cell enters in edit mode. Since the column is ReadOnly the editors would not show.
That was right what I needed. Thank you!
Hi Lukas,
Thank you for the feedback. I am glad I was able to help.