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

GridDateTimeColumn with DateTimePicker popup not displaying

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter Maslin
Top achievements
Rank 1
Peter Maslin asked on 28 Jul 2009, 09:32 AM

hi

i have a grid in a nested view template with  a GridDateTimeColumn in it , but on insert/edit mode the datepicker does not show , it simply seems to go to the top of the screen when the picker button is clicked ,
the column is created as follows :-

        private GridDateTimeColumn CreateDateGridColumn(XmlAttribute xAtt, XmlNode xControl, RadAjaxPanel PlaceHolder1)  
        {  
            System.Web.UI.Control Test = Builder.FindControl(PlaceHolder1.Controls, xAtt.Name + "Editor");  
            if (Test.ID == null)  
            {  
                GridDateTimeColumnEditor DTE = new GridDateTimeColumnEditor();  
                DTE.ID = xAtt.Name + "Editor";  
 
                PlaceHolder1.Controls.Add(DTE);  
            }  
 
            GridDateTimeColumn DT = new GridDateTimeColumn();  
            DT.UniqueName = xAtt.Name;  
            DT.HeaderText = xControl.Attributes["Caption"].Value;  
            DT.PickerType = GridDateTimeColumnPickerType.DatePicker;  
            DT.DataFormatString = "{0:MM/dd/yyyy}";  
            DT.ColumnEditorID = xAtt.Name + "Editor";  
            DT.DataField = xAtt.Name;  
            DT.SortExpression = xAtt.Name;  
            DT.ItemStyle.Width = Unit.Pixel(120);  
            DT.FilterControlWidth = Unit.Pixel(50);  
            DT.DataType = System.DateTime;  
 
            DT.EmptyDataText = " ";  
            return DT;  
        } 

the grid is created in the Page_init function, i am also using the latest version of the telerik controls.

can anyone suggest a reason why the picker would not be popping up ?

Peter.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 28 Jul 2009, 11:05 AM
Hello Peter,

I went through your code and it looks fine to me. At this point it will be best if you open a formal support ticket and send us a small working project that demonstrates this erroneous behavior. Thus we could do our best to help you further in resolving it.

Additionally, please review the following articles which elaborates on this subject:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
http://www.telerik.com/help/aspnet-ajax/grdcolumntypes.html

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Marco
Top achievements
Rank 1
answered on 22 Jul 2010, 11:51 AM
Hi there,

I have same problem here reported.
DateTimeColumn with TimePiker which don't pops-up in EditMode (nor in InsertMode). Please note I'm requested to use EditMode InPlace.

The column is bound to a custom class wich is exposing a TimeSpan in its property Stop.

Here is the relevant code:
<telerik:GridDateTimeColumn UniqueName="Stop" DataField="Stop" HeaderText="Fine"
                   DataType="System.TimeSpan" 
                   PickerType="TimePicker" ConvertEmptyStringToNull="true">
                      <HeaderStyle width="10%"/>
                   </telerik:GridDateTimeColumn>

and the relevant C# method in which you can see I have played enought trying to achieve the result.

protected void GrdTimeSlice_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (!((e.Item is GridEditableItem) & e.Item.IsInEditMode)) return;
            GridEditableItem item = (GridEditableItem)e.Item;
            RadDateTimePicker startTimePicker = (RadDateTimePicker)item["Start"].Controls[0];
            startTimePicker.TimeView.TimeFormat = @"HH:mm";
            startTimePicker.TimeView.Interval = new TimeSpan(00, 30, 00);
            startTimePicker.ShowPopupOnFocus = true;
            startTimePicker.SharedTimeView.TimeFormat = @"HH:mm";
            startTimePicker.DateInput.DateFormat = @"HH:mm";
            startTimePicker.DateInput.DisplayDateFormat = @"HH:mm";
                 
            //startTimePicker.TimeView.StartTime = new TimeSpan(00, 08, 00);
            //startTimePicker.TimeView.EndTime = new TimeSpan(00, 20, 00);
 
            RadDateTimePicker stopTimePicker = (RadDateTimePicker)item["Stop"].Controls[0];
            stopTimePicker.TimeView.TimeFormat = @"HH:mm";
            stopTimePicker.TimeView.Interval = new TimeSpan(00, 30, 00);
            //stopTimePicker.TimeView.StartTime = new TimeSpan(00, 08, 00);
            //stopTimePicker.TimeView.EndTime = new TimeSpan(00, 20, 00);
        }

Does the problem find a solution?

Reguards,
0
Peter Maslin
Top achievements
Rank 1
answered on 22 Jul 2010, 12:02 PM
hi there

actually i found a solution by not actually defining the editors at all and letting the system create its own and it worked fine , as long as the whole grid is wrapped in an RadAjaxPanel it works perfectly.

but in the end i have descided to not use grids at all , and have started using listviews as they provide much more functionality than the grids and they can be styled to look alot better.

Tags
Grid
Asked by
Peter Maslin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Marco
Top achievements
Rank 1
Peter Maslin
Top achievements
Rank 1
Share this question
or