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.
Syncfusion Feedback

grid cell text

Thread ID:

Created:

Updated:

Platform:

Replies:

89077 Aug 18,2009 04:02 AM UTC Aug 20,2009 09:36 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Stephen Hui
Asked On August 18, 2009 04:02 AM UTC

Hi,

(1)
I am trying to get the grid cell's text all highlighted when a user click (or move) on a cell, so that when he starts typing values, the old values will be wiped out automatically.

I tried using this event handler

void GridEditor_CurrentCellInitializeControlText(object sender, GridCurrentCellInitializeControlTextEventArgs e)
{
GridEditor gridEditor = (GridEditor)sender;
GridCurrentCell cell = gridEditor.CurrentCell;
cell.BeginEdit(true);
}

however, the cell.BeginEdit(true) does not work. can you tell me why?

(2)
second question is regarding the export to excel feature. is there any way to implement this feature if I only have .NET 3.0
the GridExcelConverterControl class requires dll reference from .NET 3.5

thanks,
Stephen

Jisha Joy [Syncfusion]
Replied On August 20, 2009 09:36 AM UTC

Hi Stephen,

Thank you for posting query to us.

Issue 1:

The desired behavior can be achieved by setting the ActivateCurrentCellBehavior property to GridCellActivateAction.SelectAll. See the code:

this.gridControl1.ActivateCurrentCellBehavior = Syncfusion.Windows.Forms.Grid.GridCellActivateAction.SelectAll;
Issue 2:

The Essential Grid control has in-built support for Excel Export. The class GridExcelConverterControl provides support for exporting data from a GridControl or GridDataBoundGrid control into an Excel spreadsheet. The GridToExcel method should be used to export the grid to an excel sheet. Here is the code snippet that is used to  convert the contents of the GridControl to Excel.

[C#]
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl(); 
gecc.GridToExcel(this.gridControl1.Model,@"C:\MyGC.xls");

For more details see the following sample from our sample browser:

GridSamples ---->Export ---->GC XLS Export Demo

Regards,
Jisha

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.

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

;