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

MultiExtended and Enter edit mode

Thread ID:





11874 Mar 17,2004 12:47 PM UTC Mar 18,2004 05:26 PM UTC WinForms 2
Tags: GridControl
Matthew Brohn
Asked On March 17, 2004 12:47 PM UTC

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 03:48 PM UTC

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)))

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

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


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