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.

WPF SpreadSheet Doubleclick event to get the cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

108741 May 9,2013 07:03 AM Feb 10,2018 04:39 PM WPF 2
loading
Tags: SpreadsheetControl(Classic)
Abraham. P
Asked On May 9, 2013 07:03 AM

Hi
 
below is the code for my wpf form
<Grid Width="Auto">
<syncfusion:SpreadsheetRibbon Height="95" HorizontalAlignment="Stretch" Margin="12,26,0,0" Name="SpreadsheetRibbon1" VerticalAlignment="Top" Width="Auto" />
<syncfusion:SpreadsheetControl Height="Auto" HorizontalAlignment="Stretch" Margin="12,119,0,0" Name="SpreadsheetControl1" VerticalAlignment="Stretch" Width="Auto" />
</Grid>

and I have few vb forms, in that I placed the control for some opteration.

In ReportView form I displayed the result in the spreadsheet, I want to get the value of cell when user double click the cell.

If there is any samples plz let me know.

 

Thanks & Regards,

Abraham. P


Pannir Selvam S [Syncfusion]
Replied On May 16, 2013 09:31 AM

Hi Abraham,

 

Thanks for using Syncfusion product.

 

When double clicks on the cell, you can get the cellvalue by handling the CellClick event of GridControl like in the below code snippet.

 

Code Snippet[C#]:

 
this.spreadSheetControl.WorkBookLoaded += spreadSheetControl_WorkBookLoaded;

 

void spreadSheetControl_WorkBookLoaded(object sender, Syncfusion.Windows.Controls.Spreadsheet.WorkbookLoadedEventArgs args)

{

    foreach (var grid in args.GridCollection)

    {

        grid.CellClick += new GridCellClickEventHandler(grid_CellClick);

    }

}

void grid_CellClick(object sender, GridCellClickEventArgs e)

{

    var grid = sender as GridControl;

    if (e.ClickCount == 2)

    {

        var cellValue = grid.CurrentCell.Renderer.CurrentStyle.CellValue;

        MessageBox.Show(cellValue.ToString());

    }

}

 

 

We have prepared a sample based on this and you can find the sample from the below location.

 

Please let us know if you have any other queries.

 

Regards,

Pannir



Spreadsheet Demo_3d26e475.zip

salingers
Replied On February 10, 2018 04:39 PM

I agree to the privacy policy and terms of service.

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.

;