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

Show todays date in datetimecolumn

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 05 Nov 2012, 05:16 AM
I am using a datetimecolumn with filtering in radgrid. How can I show today's date as selected on opening the filter pop up?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Nov 2012, 05:45 AM
Hi Tina,

Try the following code snippet to achieve your scenario.

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

Hope this helps.

Regards,
Princy.
Tags
General Discussions
Asked by
Tina
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or