We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DateTimeCellModel Calenadar appears in wrong place

Thread ID:





68746 Oct 1,2007 08:33 AM UTC Oct 2,2007 08:52 AM UTC WinForms 3
Tags: GridControl
Asked On October 1, 2007 08:33 AM UTC

There is a strange behaviour in DateTimeCellModel.

Example attached.

Step 0: Run attached solution
Step 1: Single click on one of grid cells
Step 2: Now click on the textbox in right upper corner
Step 3: Click on "dropdown" button (with small triangle) in previously clicked cell

Calendar appears in right bottom corner of the screen. How can I fix this problem?


Administrator [Syncfusion]
Replied On October 1, 2007 03:08 PM UTC

You can avoid the problem by hiding the DatTimePicker when the grid loses focus. At the bottom of the renderer's contructor, add this code to subscribe to the event.

grid.LostFocus += new EventHandler(grid_LostFocus);

Then use this handler.

void grid_LostFocus(object sender, EventArgs e)
if (dateTimePicker.Visible)

Replied On October 2, 2007 07:27 AM UTC

You mean something like this for GDBG:

void gridDataBoundGrid1_LostFocus(object sender, EventArgs e)
if (gridDataBoundGrid1.CurrentCell.Renderer.Control.Visible)

Is there a way to avoid this problem at DateTimeCellModel component level? I need to implement datetimepicker cell in quite big application where a lot grids are used. It would be much easer to make changes in one place then add event handler to each grid.

Administrator [Syncfusion]
Replied On October 2, 2007 08:52 AM UTC

I was suggesting doing this in the renderer code.

public DateTimeCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
: base(grid, cellModel)
dateTimePicker = new MyDateTimePicker();

dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Short;
dateTimePicker.NullString = "";
dateTimePicker.ShowUpDown = false;
dateTimePicker.ShowCheckBox = false;
dateTimePicker.ShowDropButton = true;
dateTimePicker.Border3DStyle = Border3DStyle.Flat;


//show & hide to make sure it is initilized properly for teh first use...


grid.LostFocus += new EventHandler(grid_LostFocus);//added.......

void grid_LostFocus(object sender, EventArgs e)
if (dateTimePicker.Visible)


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon