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.

MultiExtended and Enter edit mode

Thread ID:

Created:

Updated:

Platform:

Replies:

11874 Mar 17,2004 07:47 AM Mar 18,2004 12:26 PM Windows Forms 2
loading
Tags: GridControl
Matthew Brohn
Asked On March 17, 2004 07:47 AM

We are working on a project that would require full rows to be selected and use of ctrl and shift. This is easy through gridControl1.ListBoxSelectionMode = SelectionMode.MultiExtended; However, we also only want to enter edit mode only if the user clicks on a currently selected row''s cell. IE, the first click on a cell will select the entire row, the second click on the cell will make it editable. Currently we have the grid set up as gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent; Better option? What is the proper strategy for accomplishing this?

Administrator [Syncfusion]
Replied On March 17, 2004 10:48 AM

I think you can do this by: 1) Adding member to your form: GridRangeInfoList rangeList; 2) in FormLoad: this.grid.ActivateCurrentCellBehavior = GridCellActivateAction.None; rangeList = this.grid.Selections.GetSelectedRows(false, true).Clone(); 3) Handle the grid''s MouseUp eevnt and save the selections. private void grid_MouseUp(object sender, MouseEventArgs e) { rangeList = this.grid.Selections.GetSelectedRows(true, false).Clone(); } 4) handle the grid''s MouseDown and start editing if the cell is in the saved selections.
private void grid_MouseDown(object sender, MouseEventArgs e)
{
	int row, col;
	if(rangeList.Count > 0 && 
		this.grid.PointToRowCol(new Point(e.X, e.Y), out row, out col, -1))
	{
		if(rangeList.AnyRangeContains(GridRangeInfo.Cell(row, col)))
		{
			this.grid.CurrentCell.BeginEdit();
		}
	}
}	

Administrator [Syncfusion]
Replied On March 18, 2004 12:26 PM

As Always, Clay Your the Man!!! Works great!

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.

;