Hi,
1. if I have "(A1 + B1)" formula in C1, will this automatically apply/compute for values in A2 and B2 in C2 and so on?
---------------------
You can copy formulas into adjacent cells by using the fill handle (fill handle: The small black square in the lower-right corner of the selection. When you point to the fill handle, the pointer changes to a black cross.) can be achieved by using the ExcelMarkerMouseController, which could be found in the \Syncfusion\Essential Suite\Grid\Samples\In Depth\ExcelSelectionMarker sample, and by setting the FormulaCopyFlags of GridFormulaEngine as mentioned below.
GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine;
engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardReferencesAdjusted;
The first cell value should be copied and pasted in all the dragged cells in the MouseUp event of the ExcelMarkerMouseController.
Please refer to the sample given below which illustrates the above:
http://websamples.syncfusion.com/samples/Grid.Windows/I40755/main.htm2)How do I create tab sheets?
You can create tab sheets using the following code snippet:
WorkbookModel workbook;
workbook = new WorkbookModel("Workbook");
GridModel sheet1 = new GridModelEx();
SampleGrid.SetupGridModel(sheet1);
workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 1", sheet1));
3)Is there drag and fill (autofill) feature?
Please refer to the following browser sample for drag support.
\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Windows\Samples\2.0\DragDropSupport\
Take a look at the Syncfusion\Essential Suite\Grid\Samples\In Depth\ExcelSelectionMarker sample. In that sample, if you position the cursor over the bottom right corner of a cell or selection, you get a special drag cursor that allows you to expand the selection by dragging. When you release the drag, in the sample a message box pops up that gives you the range selected. At that point, you could do your auto-fill. Now the sample does not actually do the autofill, but depending on what you want to do, you could use grid.ChangeCell to change the whole range to have the same style as the top left cell. Or, you could just loop through the range, explicitly setting values in some logical way depending upon what you want.
4) How do I change the Header value?
You can change the column header text using the following code snippet.
if (e.ColIndex == 1 && e.RowIndex == 0)
{
e.Style.Text = "Data Creazione";
}
5)How to make the cellpointer move to next row when enter key is pressed.
For that you need to handle CurrentCellControlKeyMessage event.
private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
if(Keys.keyCode == Keys.Enter)
{
this.gridControl1.CurrentCell.MoveTo(ro+1,col);
}
}
6)Sort columns
Please refer this forum thread, which deals with multicolumn sorting in a gridcontrol and let me know if this helps.
Example on How to Multi-Column Sort with GridControl Please let me know if this helps.
Retgards,
Nisha
>Thank you for the quick reply. I noticed that you mostly used C# in your sample code here, I am using vb2005 is any possibilities that you show examples in VB?
I have some other concerns.
1. if I have "(A1 + B1)" formula in C1, will this automatically apply/compute for values in A2 and B2 in C2 and so on?
2. how do I create tab sheets?
3. Is there drag and fill (autofill) feature?
4. How do I change the Header value?
5. How to make the cellpointer move to next row when enter key is pressed.
6. Sort columns (ex. Column A - LastName, Column B - FirstName, Column C - Gender. Column C is the primary key sorted Descending and Column A is the secondary key sorted Ascending.