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

MonthYearPicker in Filter

3 Answers 81 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 26 Mar 2013, 03:19 PM
Have a column in my DataGrid which I have formatted to GridDateTimeColumn and set the filter option to include the Datapicker. 

What I would like to do is use the MonthYearPicker instead. How would I go about this?  Also when passing the filtered date along I want to verify it is the last day of that month, is there a way to do that in the control?
<telerik:GridDateTimeColumn DataField="cycle_date" DataFormatString="{0:d}"
 FilterControlAltText="Filter column13 column" HeaderText="CYCLE DATE"
 MinDate="1993-01-01" UniqueName="cycle_date" DataType="System.DateTime"
 EditDataFormatString="MM/YYYY">
 <HeaderStyle HorizontalAlign="Center" />
 <ItemStyle HorizontalAlign="Right" Width="125px" />
</telerik:GridDateTimeColumn>

3 Answers, 1 is accepted

Sort by
0
Kurt Kluth
Top achievements
Rank 1
answered on 26 Mar 2013, 03:38 PM
Have figured out the first part by using <FitlerTemplate> for the column. 

How can I get the Filter icon to show for this column?  It only shows a textbox to hold the value and picker.  Also when I select a date it will set the date to "03/year selected".  I can't get it to give me any other month.
<telerik:GridDateTimeColumn DataField="cycle_date" DataFormatString="{0:MM/yyyy}"
    FilterControlAltText="Filter cycle_date column" HeaderText="CYCLE DATE"
    UniqueName="cycle_date" DataType="System.DateTime"
    ShowFilterIcon="True">
    <HeaderStyle HorizontalAlign="Center" />
    <ItemStyle HorizontalAlign="Right" Width="125px" />
    <FilterTemplate>
        <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" DateInput-DateFormat="MM/yyyy"
        AutoPostBack="False" ViewStateMode="Enabled" DatePopupButton-ToolTip="Filter for a specific Cycle Date."
        ShowPopupOnFocus="True"
        MonthYearNavigationSettings-NavigationNextText="Next" MonthYearNavigationSettings-NavigationNextToolTip="Next View"
        MonthYearNavigationSettings-NavigationPrevText="Prev" MonthYearNavigationSettings-NavigationPrevToolTip="Previous View">
        </telerik:RadMonthYearPicker>
    </FilterTemplate>
</telerik:GridDateTimeColumn>
0
Accepted
Princy
Top achievements
Rank 2
answered on 27 Mar 2013, 07:02 AM
Hi,

One suggestion is that you can customize the template by  placing an Image in the filtertemplate. Check the following help documentation for more.
Filter Template

Thanks,
Princy
0
Kurt Kluth
Top achievements
Rank 1
answered on 27 Mar 2013, 08:58 PM
Princy,

Thank you for your response.  We ended up turning off filtering in the datagrid, but know this will come up in the future.

Tags
Filter
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Kurt Kluth
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or