How to modify calendar of GridDateTimeColumn?

2 posts, 0 answers
  1. Henrik Brinch
    Henrik Brinch avatar
    100 posts
    Member since:
    Aug 2004

    Posted 28 May 2008 Link to this post

    I'm trying to disable the navigation for a GridDateTimeColumn, so far without any luck.

    I've tried the code below, but it doesn't seem to work - how can I accomplish this?

      protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
      {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
        {  
          GridEditableItem item = e.Item as GridEditableItem;  
          GridDateTimeColumnEditor editor = (GridDateTimeColumnEditor)item.EditManager.GetColumnEditor("column3");  
          editor.PickerControl.Calendar.EnableNavigation = false;  
        }  
      }  
     
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 May 2008 Link to this post

    Hi,

    Try the following code snippet to access the DatePicker from the GridDateTimeColumn  in edit mode.

    ASPX:
    <telerik:GridDateTimeColumn UniqueName="DateCol" HeaderText="DateCol" DataType="System.DateTime" DataField="OrderDate" ></telerik:GridDateTimeColumn> 

    CS:
     protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)  
        {  
            if ((e.Item is GridEditableItem)&&(e.Item.IsInEditMode))  
            {  
                GridEditableItem item = (GridEditableItem)e.Item;  
                RadDatePicker pkr = (RadDatePicker)item["DateCol"].Controls[0];  
                pkr.Calendar.EnableNavigation = false;  
     
            }  
        } 


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