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

excel like behavior -- possible?

In Excel there is a feature where you can select a cell and position the cursor over the bottom right corner; the cursor shape changes to a plus sign and I can click and drag and copy the value in the selected cell to a range of cells. Is this possible with EssentialGrid (currently we are using version 2.1.0.9). Thanks for the info, Cathy

6 Replies

AD Administrator Syncfusion Team November 15, 2004 04:19 PM

The \Syncfusion\Essential Suite\2.1.0.9\Grid\Samples\In Depth\ExcelSelectionMarker sample has a custom mousecontroller that handles the selection dragging part of this process. You can copy it to your project and get the drag behavior. The sample controller just gives you the expanded range, but you could add code to copy the original cell to the newly expanded range,


CN Cathy Noakes November 19, 2004 02:17 PM

Clay, Thanks for the help. I have it mostly working the way I want it to, but sometimes after I have successfully selected a cell and dragged once. I select another cell and the drag does not work. In debugging, I can see that when it gets into the MouseMove method the dragWindow is undefined, as if the MouseDown method was never called. Does this ring any bells with you? When running the sample I cannot get it to break. Any ideas? Thanks again, Cathy


AD Administrator Syncfusion Team November 19, 2004 05:05 PM

Just something to try to see if it has any effect on this problem. Set grid.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell;


JE jeaning December 13, 2004 10:34 AM

Hi, I have a question about ActiveCurrentCellBehavior. In my GridDataBindGrid, there are four columns. Column one is editable, I want the cursor change to "I", Column two can be editable if Column Four is true. Column Three and Column four are not editable at all so that I want the sursor is Arrow. I use CurrentCellActived event to set ActiveCurrentCellBehavior either to "SetCurrent" or "None". If I use keyboard to edit and access the cells in the same row one after another, the effect seems to be a columns delay. I am not sure which event is the best for my senario. Thanks, jeaning >Just something to try to see if it has any effect on this problem. > >Set > >grid.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell; >


AD Administrator Syncfusion Team December 13, 2004 04:21 PM

One way you can do this is to set and leave this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;. Then handle the CurrentCellStartEditingt event and cancel it if the current cell is in a row and column you do not want to edit.
private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.ColIndex > 2 || (cc.ColIndex == 2 && this.gridControl1[cc.RowIndex, 4].Text != "1"))
	{
		e.Cancel = true;
	}
}


AD Administrator Syncfusion Team December 20, 2004 06:36 AM

It works so well.Thanks jeaning >One way you can do this is to set and leave this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;. > >Then handle the CurrentCellStartEditingt event and cancel it if the current cell is in a row and column you do not want to edit. >
>private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
>{
>	GridCurrentCell cc = this.gridControl1.CurrentCell;
>	if(cc.ColIndex > 2 || (cc.ColIndex == 2 && this.gridControl1[cc.RowIndex, 4].Text != "1"))
>	{
>		e.Cancel = true;
>	}
>}
>

Loader.
Live Chat Icon For mobile
Up arrow icon