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.

GridListControl - Select Multiple Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

74896 Jul 2,2008 12:09 PM Feb 27,2018 12:32 AM Windows Forms 10
loading
Tags: GridControl
Edward Wilkerson
Asked On July 2, 2008 12:09 PM

Hi

I have a GridListControl. I would like to allow selections of multiple cells (not columns or rows)


Sri Rajan [Syncfusion]
Replied On July 3, 2008 02:47 AM

Hi Ed,

Thank you for your interest in Syncfusion products.

1) To Select cells programatically
>>>>

this.gridListControl1.Grid.Model.Selections.Add(GridRangeInfo.Cells(1, 1, 4, 3));


2) To Select Cells through mouse.
>>>>

void Grid_MouseUp(object sender, MouseEventArgs e)
{
IsMouseDown = false;
}

void Grid_MouseMove(object sender, MouseEventArgs e)
{
if (IsMouseDown)
{
Point pt = new Point(e.X, e.Y);
int row,col;
this.gridListControl1.Grid.PointToRowCol(pt, out row,out col);
this.gridListControl1.Grid.Selections.Add(GridRangeInfo.Cell(row, col)); }
}
bool IsMouseDown = false;
void Grid_MouseDown(object sender, MouseEventArgs e)
{
IsMouseDown = true;
}


Please let me know if this helps.

Best Regards,
Srirajan.


Edward Wilkerson
Replied On July 3, 2008 11:04 AM

Thanks so much
Since my concern is being able to select a variety of individual cells, update a table with those selections and highlight those cells when the gridlist is reopened would it have made move sense to use a GridControl?

>Hi Ed,

Thank you for your interest in Syncfusion products.

1) To Select cells programatically
>>>>

this.gridListControl1.Grid.Model.Selections.Add(GridRangeInfo.Cells(1, 1, 4, 3));


2) To Select Cells through mouse.
>>>>

void Grid_MouseUp(object sender, MouseEventArgs e)
{
IsMouseDown = false;
}

void Grid_MouseMove(object sender, MouseEventArgs e)
{
if (IsMouseDown)
{
Point pt = new Point(e.X, e.Y);
int row,col;
this.gridListControl1.Grid.PointToRowCol(pt, out row,out col);
this.gridListControl1.Grid.Selections.Add(GridRangeInfo.Cell(row, col)); }
}
bool IsMouseDown = false;
void Grid_MouseDown(object sender, MouseEventArgs e)
{
IsMouseDown = true;
}


Please let me know if this helps.

Best Regards,
Srirajan.




Sri Rajan [Syncfusion]
Replied On July 4, 2008 04:58 AM

Hi Ed,

Thank you for your continued interest in Syncfusion products.

If your intention is to persist selection,GridControl is the best choice instead of GridListControl. You can serialize your grids using GridModel.LoadBinary and GridModel.SaveBinary methods(or LoadSoap & SaveSoap methods). You can also change your GridControl to behave like a GridList Control.

Please refer the below code for GridControl Serialization:

Grid Samples-->Serialization-->GridControl

Local Path:
\My Documents\Syncfusion\EssentialStudio\6.1.0.34\Windows\Grid.Windows\Samples\2.0\Serialization\GridControl\cs

Please let me know if this helps.

Best Regards,
Srirajan.


Edward Wilkerson
Replied On July 17, 2008 04:52 PM

Hi Srirajan

Thank you so much for your help. I would like to alter the Custom Drop Down Gridlistcontrol so that the user may make multiple cell selections by right clicking a cell. The Drop Down may be closed and saved by double clicking when chosing the last selected cell

>Hi Ed,

Thank you for your continued interest in Syncfusion products.

If your intention is to persist selection,GridControl is the best choice instead of GridListControl. You can serialize your grids using GridModel.LoadBinary and GridModel.SaveBinary methods(or LoadSoap & SaveSoap methods). You can also change your GridControl to behave like a GridList Control.

Please refer the below code for GridControl Serialization:

Grid Samples-->Serialization-->GridControl

Local Path:
\My Documents\Syncfusion\EssentialStudio\6.1.0.34\Windows\Grid.Windows\Samples\2.0\Serialization\GridControl\cs

Please let me know if this helps.

Best Regards,
Srirajan.




Edward Wilkerson
Replied On July 17, 2008 05:53 PM

Hi Again

I don't really need the serialization. I store the selected values in the cell of the underlying grid. I would just like to be able to click or right click on the cells to select them (without using the CTRL key). When the user double clicks the values are saved into the underlying cell.

>Hi Srirajan

Thank you so much for your help. I would like to alter the Custom Drop Down Gridlistcontrol so that the user may make multiple cell selections by right clicking a cell. The Drop Down may be closed and saved by double clicking when chosing the last selected cell

>Hi Ed,

Thank you for your continued interest in Syncfusion products.

If your intention is to persist selection,GridControl is the best choice instead of GridListControl. You can serialize your grids using GridModel.LoadBinary and GridModel.SaveBinary methods(or LoadSoap & SaveSoap methods). You can also change your GridControl to behave like a GridList Control.

Please refer the below code for GridControl Serialization:

Grid Samples-->Serialization-->GridControl

Local Path:
\My Documents\Syncfusion\EssentialStudio\6.1.0.34\Windows\Grid.Windows\Samples\2.0\Serialization\GridControl\cs

Please let me know if this helps.

Best Regards,
Srirajan.






Sri Rajan [Syncfusion]
Replied On July 28, 2008 08:39 AM

Hi Ed,

Sorry for delay in getting back to you.

I am not able to understand you requirements clearly. Can you please provide me some more information?. That will help us to analyze this issue further.

Best Regards,
Srirajan.


Binu.A
Replied On August 18, 2008 03:02 PM

Dear Srirajan,
The sample given by you were useful. I have a requirement to have the Excel-like feature of formula copy. Presently when user mouse clicks on a cell with formula, the underlying formula is shown. The requirement is that if the user has formula =A1+B1 in cell C1 and he pastes the Formula in C2,then the formula should copied as =A2+B2 and the result should be shown.
Could you suggest me a best possible way to do this?

Thanks
Binu


Sri Rajan [Syncfusion]
Replied On August 19, 2008 08:05 AM

Hi Binu,

Thank you for your continued interest in Syncfusion products.

1) If you want Excell like Formula Copy, then you need to set FormulaCopyFlags property of the Formula engine as ClipBoardReferencesAdjusted.

2) If you want Excell like Formula Dragging, then you need to set the properties ExcelLikeCurrentCell, ExcelLikeSelectionFrame as true and set the

Controlleroptions as All. Also you need to add MouseControllerDispatcher. Here ExcelMarkerMouseController is custom MouseController.

Please refer the below code for more details.

//For Excell Like Formula Paste
GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine;
engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardReferencesAdjusted;


//For Excell Like Formula Draging

this.gridControl1.ExcelLikeCurrentCell = true;
this.gridControl1.ExcelLikeSelectionFrame = true;

this.gridControl1.ControllerOptions = GridControllerOptions.All & (~GridControllerOptions.OleDataSource);
this.gridControl1.MouseControllerDispatcher.Add(new ExcelMarkerMouseController(this.gridControl1));



Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F74896Aug19/GridControl_FormulaPaste.zip

Please let me know if this helps.

Best Regards,
Srirajan.


muhammad alwan a
Replied On February 26, 2018 10:13 AM

Hi Again

I don't really need the serialization. I store the selected values in the cell of the underlying grid. I would just like to be able to click or right click on the cells to select them (without using the CTRL key). When the user double clicks the values are saved into the underlying cell.

>Hi Srirajan

Thank you so much for your help. I would like to alter the Custom Drop Down Gridlistcontrol so that the user may make multiple cell selections by right clicking a cell. The Drop Down may be closed and saved by double clicking when chosing the last selected cell

>Hi Ed,

Thank you for your continued interest in Syncfusion products.

If your intention is to persist selection,GridControl is the best choice instead of GridListControl. You can serialize your grids using GridModel.LoadBinary and GridModel.SaveBinary methods(or LoadSoap & SaveSoap methods). You can also change your GridControl to behave like a GridList Control.

Please refer the below code for GridControl Serialization:

Grid Samples-->Serialization-->GridControl

Local Path:
\My Documents\Syncfusion\EssentialStudio\6.1.0.34\Windows\Grid.Windows\Samples\2.0\Serialization\GridControl\cs

Please let me know if this helps.

Best Regards,
Srirajan.






thanks

Attachment: 3806_771d6550.rar

Arulpriya Ramalingam [Syncfusion]
Replied On February 27, 2018 12:32 AM

Hi Muhammad, 
 
Thanks for your update. 

Please let us know that whether you need further assistance on this. 
 
Regards, 
Arulpriya 


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.

;