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.

virtualgrid combobox problems

Thread ID:

Created:

Updated:

Platform:

Replies:

22294 Dec 9,2004 01:39 AM Dec 12,2004 10:27 PM Windows Forms 4
loading
Tags: GridControl
yan
Asked On December 9, 2004 01:39 AM

Hi, in my virtualgrid there are combobox cells, the following code works fine void GridQueryCellInfo (object sender, GridQueryCellInfoEventArgs e) { ... e.Style.CellType = "ComboBox"; e.Style.ChoiceList = items; ... } however in my application, i also need to get the CellMouseDown/CellMouseUp events to be raised, when i handle the CellHitText event, and return a non-zero result when the mouse is over a cell where i want to get those events using following code: private void gridControl1_CellHitTest(object sender, GridCellHitTestEventArgs e) { e.Result = 1; } the comboBox does not work when i click the corresponding cell!!! any idea how to solve this problem? thanks, yan zhao

Administrator [Syncfusion]
Replied On December 9, 2004 03:08 AM

One way around this is to add code to your gridControl1_CellHitTest handler that tests if the cell is a combobox cell (and maybe if the mouse is over the button), and if it is, return 0 instead of 1.

yan
Replied On December 9, 2004 04:53 PM

thanks for the replying! could you please give more detail about how to know if the mouse is over the button? >One way around this is to add code to your gridControl1_CellHitTest handler that tests if the cell is a combobox cell (and maybe if the mouse is over the button), and if it is, return 0 instead of 1.

Administrator [Syncfusion]
Replied On December 9, 2004 06:44 PM

Here is some code that work for me in grid_MouseMove. You could probably use something similar in your event.
private void gridControl1_MouseMove(object sender, MouseEventArgs e)
{
	int row, col;
	Point pt = new Point(e.X, e.Y);
	if(this.gridControl1.PointToRowCol(pt, out row, out col))
	{
		if(this.gridControl1[row, col].CellType == "ComboBox")
		{
			//Console.WriteLine("xxxxOverButton");
			Rectangle rect = this.gridControl1.RangeInfoToRectangle(this.gridControl1.PointToRangeInfo(pt));
			if(rect.Right - 20 < pt.X)
			{
				Console.WriteLine("OverButton");
				//set hitest = 0;
			}

		}
	}
}

yan
Replied On December 12, 2004 10:27 PM

Thank you very much! that''s exactly what i need. >Here is some code that work for me in grid_MouseMove. You could probably use something similar in your event. >
>private void gridControl1_MouseMove(object sender, MouseEventArgs e)
>{
>	int row, col;
>	Point pt = new Point(e.X, e.Y);
>	if(this.gridControl1.PointToRowCol(pt, out row, out col))
>	{
>		if(this.gridControl1[row, col].CellType == "ComboBox")
>		{
>			//Console.WriteLine("xxxxOverButton");
>			Rectangle rect = this.gridControl1.RangeInfoToRectangle(this.gridControl1.PointToRangeInfo(pt));
>			if(rect.Right - 20 < pt.X)
>			{
>				Console.WriteLine("OverButton");
>				//set hitest = 0;
>			}
>
>		}
>	}
>}
>

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.

;