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.
Unfortunately, activation email could not send to your email. Please try again.

GridControlBase

Thread ID:

Created:

Updated:

Platform:

Replies:

27553 Apr 14,2005 08:11 AM Apr 21,2005 12:08 PM Windows Forms 8
loading
Tags: GridControl
Stefan Tsalapatis
Asked On April 14, 2005 08:11 AM

Hi, I have derived a class from GridControl which does everything I want for a light editable Grid implementation. I have read your newer help text in class GridControlBaseImp which explains the differences of GridControlBase - GridControlBaseImp -GridControl. QUESTION 1: I would like if possible to derive my class from GridControlBase. My code seems ok except I override OnColWidthsChanged OnQueryColWidth ( GridControl) Is there any equivalent functions in GridControlBase ? Question 2: From your Help : "GridControlBase... you need to manually initialize MouseControllers and cell types. " Can you remind me if there is any sample with such code or do you have any in your site ? Thanks Regards Stefan

Administrator [Syncfusion]
Replied On April 14, 2005 08:55 AM

similar in your derived GridControlBase. To initialize the mouse controllers, take a look at the code in C:\Program Files\Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Src\Extensions\Control\GridControlBaseImp.cs(146): protected override void InitializeMouseControllers() To initialize celltypes, you call Model.CellModels.Add for the celltypes you want to use.

Stefan Tsalapatis
Replied On April 14, 2005 09:31 AM

Thanks , But as for the first question the overridable OnColWidthsChanged OnQueryColWidth exist only in a GridControl. In GridControlBase Source I can see only private ModelRowHeightsChanged ModelColWidthsChanged Do you mean to subscribe to events Model.ColWidthsChanged Model.QueryColWidth I will do this.

Administrator [Syncfusion]
Replied On April 14, 2005 10:51 AM

Part of my response did not make it to the post. The OnColWidthsChanging methods in GridControl just wrapper methods for calling a handler for Model.ColWidthsChanging. What I was trying to suggest is that you could add the same code to your derived GridControlBase class to wrapped to a Model.ColwidthsChanging event handler.

Stefan Tsalapatis
Replied On April 21, 2005 08:25 AM

Hi, I have set the MouseControllers in a GridControlBase. (only the base controllers) But I have a problem that does not seem related to specific controllers . I had implemented in a special grid to change the row background color when the mouse hovers in another row mousemove event -> PointToRowCol ClearSelections SelectRange(row) With ControlBaseImp the above works. Not with ControlBase Regards

Administrator [Syncfusion]
Replied On April 21, 2005 08:36 AM

Exactly what fails? Can you select a range of cells with the mouse (to verify the cellselection controller is hooked up)? If you upload a sample project showing the problem, we can try to work with it here?

Stefan Tsalapatis
Replied On April 21, 2005 09:42 AM

See the sample GridControlBase1_1839.zip

Administrator [Syncfusion]
Replied On April 21, 2005 11:01 AM

The rows are not being invalidated so that is why you do not see the selections. Try this code in your GridControlBase class.
int oldRow = -1;
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
{  
	int row, col;
	Point pt = new Point(e.X, e.Y);
	PointToRowCol(pt, out row, out col);
	Selections.Clear();
	Selections.SelectRange(GridRangeInfo.Row(row), true);
	if(oldRow > - 1)
		this.RefreshRange(GridRangeInfo.Row(oldRow));
	oldRow = row;
	this.RefreshRange(GridRangeInfo.Row(oldRow));
	base.OnMouseMove (e);
}

Stefan Tsalapatis
Replied On April 21, 2005 12:08 PM

Thanks Clay , it works.

CONFIRMATION

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.

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.

;