set default date

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 31 Jan 2013 Link to this post

    Hi,

    How can I make  RadDatePicker's default date to today's date when it opens? My RadDatePicker is one of the column in the radgrid, when I do filter, I like to open the RadDatePicker with today's date highlighted.

    Thanks,
    Sigma
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Jan 2013 Link to this post

    Hi,

    Please take  a look into the following code snippet.

    C#:
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filterItem = (GridFilteringItem)e.Item;
            RadDatePicker picker = (RadDatePicker)filterItem["UniqueName"].Controls[0];
            picker.SelectedDate = System.DateTime.Now;
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top