show special days in grid date filter

3 posts, 1 answers
  1. Mohammed
    Mohammed avatar
    87 posts
    Member since:
    Aug 2011

    Posted 13 Sep 2012 Link to this post

    Hi team,
    how can I show special days in the grid date filter ?
    regards,
    Mohammed
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Sep 2012 Link to this post

    Hi,

    Here is the sample code I tried to show special day in grid date filter as today's date.

    ASPX:
    <telerik:GridDateTimeColumn  DataField="OrderDate" HeaderText="OrderDate" UniqueName="OrderDate" PickerType="DatePicker"   DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridDateTimeColumn>

    C#:
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem fitem = (GridFilteringItem)e.Item;
            RadDatePicker pic = (RadDatePicker)fitem["OrderDate"].Controls[0];
            RadCalendarDay NewDay = new RadCalendarDay();
            NewDay.Repeatable = RecurringEvents.Today;
            NewDay.ItemStyle.BackColor = System.Drawing.Color.RoyalBlue;
            pic.SharedCalendar.SpecialDays.Add(NewDay);   
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mohammed
    Mohammed avatar
    87 posts
    Member since:
    Aug 2011

    Posted 13 Sep 2012 Link to this post

    thanks very much,
Back to Top