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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

control in a cell

Thread ID:





3417 Mar 17,2003 07:26 PM UTC Mar 17,2003 09:08 PM UTC WinForms 1
Tags: GridControl
Franklin Colbert
Asked On March 17, 2003 07:26 PM UTC

I have a situation where I wish to display a control over the active cell for a particular column. This control is not a .NET control, but rather a Win32 HWND for which I have the handle. I am creating this HWND hidden and will position it appropriately and unhide it as the user moves to the row and column. I am taking the route of Creating my own CellModel and CellRenderer. However I am stuck a bit in how to proceed from here. Any good samples? Should I create a generic .NET control and parent my HWND to it?

Administrator [Syncfusion]
Replied On March 17, 2003 09:08 PM UTC

If you only want to draw your special window when a cell is the active cell, then the simplest thing to try is to override the renderer's OnDraw method, and if the cell is a current cell and is active, then display your window. Otherwise, call the baseclass.
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style) 
	if (Grid.CurrentCell.HasCurrentCellAt(rowIndex, colIndex) && CurrentCell.IsEditing && !Grid.IsPrinting())
		//show you window....
		// static cell
		base.OnDraw(g, clientRectangle, rowIndex, colIndex, style);
As far as samples, here are some: 1) the CustomCellTutoral that displays a LinkLable cell 2) button cells in the Button cells sample 3) bitmap cells in the Exel-like selection sample. If you submit a Direct Trac incident, you can request some new samples that will be part of the upcoming 1.6 release (MaskeEdit, Currency and WinForm in a cell).


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

Live Chat Icon For mobile
Live Chat Icon