Highlight todays date

4 posts, 1 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 10 Apr 2012 Link to this post

    How to highlight today's date in DateTimeColumn when filtering in grid
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Apr 2012 Link to this post

    Hi Tina,

    Try the following code snippet.

    ASPX:
    <telerik:GridDateTimeColumn DataField="StartDate" UniqueName="StartDate" PickerType="DatePicker"></telerik:GridDateTimeColumn>

    C#:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
     if (e.Item is GridFilteringItem)
     {
       GridFilteringItem item = (GridFilteringItem)e.Item;
       RadDatePicker pkr = (RadDatePicker)item["StartDate"].Controls[0];
       RadCalendarDay NewDay = new RadCalendarDay();
       NewDay.Repeatable = RecurringEvents.Today;
       NewDay.ItemStyle.BackColor = System.Drawing.Color.Red;
       pkr.SharedCalendar.SpecialDays.Add(NewDay);
     }         
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 11 Apr 2012 Link to this post

    How to hide filtering when grid is in edit mode
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Apr 2012 Link to this post

    Hi Tina,

    Try the following code.

    C#:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
       RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0].Visible = false;
     }
    }

    Thanks,
    Shinu.
Back to Top