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

Always display user controls in grid cells as if it is the current cell

Thread ID:





34740 Sep 15,2005 09:10 AM UTC Sep 16,2005 08:23 AM UTC WinForms 4
Tags: GridControl
Georgi Kashev
Asked On September 15, 2005 09:10 AM UTC

I have a dynamicaly changing user control displayed in a cell. If I set the cell as current, everiting is ok. The changes in the user control are displayed in the grid. If the cell is not the current, the user control is static. Furthermore if the cell is the current one the user control is expanded to match the control bounds. How can I make the not current cells display the user control as if they are the current one?

Administrator [Syncfusion]
Replied On September 15, 2005 12:32 PM UTC

Hi Georgi, What you refer by ''user control is static''? Are you deriving your custom cell renderer from GridGenericControlCellRenderer? If so are you having two instances of usercontrol, one for static drawing and the other for current cell like these samples: Windows\Grid.Windows\samples\CellTypes\CalendarCells Windows\Grid.Windows\samples\CellTypes\SliderCells Can you post more information on your approach? A small sample would help us resolve the issue better. Best regards, Jay N

Georgi Kashev
Replied On September 15, 2005 01:53 PM UTC

Well, The user control has a build-in logic that refreshes some displayed data. I have created a simple project that demonstrates the problem. It shows a grid with two cells. Both cells are set to display a user control which shows the current time. You will notice that the clock runs only if the cell is selected. Otherwise it is stopped. Further more at the initial loading both cells remain empty... Can you fix this sample? I need both clocks to run. UserControlInGrid_4894.zip

Administrator [Syncfusion]
Replied On September 16, 2005 06:50 AM UTC

Hi Georgi, The ''Control'' celltype is designed such that if you assign a control to style object, grid handles the drawing in two different scenarios. For the currentcell which is in focus, it just places the control at the particular cell and gives focus to it. For other cells, it renders the control to a bitmap and then draws the bitmap instead since there won''t be active editing in it. In your scenario, you could set focus to the control in all the cells (both current and others) by having a custom cell and overriding GridGenericControlCellRenderer.OnDraw method. Please refer this modified sample to see if that helps. UserControlInGrid.zip Best regards, Jay N

Georgi Kashev
Replied On September 16, 2005 08:23 AM UTC

It''s exactly what I needed. Thanks a lot.


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