This is a migrated thread and some comments may be shown as answers.

Cell Double Click Event

3 Answers 280 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Ercument Berktas
Top achievements
Rank 1
Ercument Berktas asked on 20 Jun 2013, 10:57 AM
Hi,
We need a cell double click event on our pivot in order to get the values on that row and column. Our pivot's sample is attached.
We tried the code block below. But did not work. Can you help about this. Our product version is 2013.1.220.20
private void PivotGridReport_CellCreating(object sender, Telerik.WinControls.UI.PivotCellCreatingEventArgs e)
{
      e.CellElement.DoubleClick += new EventHandler(CellElement_DoubleClick);
}
 
void CellElement_DoubleClick(object sender, EventArgs e)
{
 
}

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 24 Jun 2013, 02:50 PM
Hello,

Thank you for writing.

You can get the double clicked cell values in few easy steps:
  • Handle the RadPivotGrid MouseDoubleClick event
  • Get the clicked cell in a PivotCellElement object using proper casting
  • Use the object to get cell values you want

Here is the sample code that corresponds the steps i took:

private void radPivotGrid1_MouseDoubleClick(object sender, MouseEventArgs e)
{        
    PivotCellElement currentCell =radPivotGrid1.PivotGridElement.ElementTree.GetElementAtPoint(e.Location) as PivotCellElement;
    if (currentCell != null)
    {
        var cellValue = currentCell.Value;
        var column = currentCell.Column.Name;
        var row = currentCell.Row.Name;
    }
}

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Mitko
Telerik
RadChart for WinForms is obsolete. Now what?
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 03 Oct 2023, 10:04 AM

Hi Dimitar

Sorry to return to this thread, but Im wanting to use your code you have suggested but I dont seem to have PivotGridElement property available when I type in the name of my rad pivot grid.

Can you advise what I could be missing please?

Thanks

 

 

Nadya | Tech Support Engineer
Telerik team
commented on 04 Oct 2023, 10:29 AM

Hello, Rakhee,

RadPivotGridElement belongs to namespace Telerik.WinControls.UI. Note that the following 3 assemblies are required for all projects that uses Telerik UI for WinForms suite:

- Telerik.WinControls 

- Telerik.WinControls.UI

- TelerikCommon

In addition to this, RadPivotGrid needs the Telerik.WinControls.PivotGrid reference as well. Could you please make sure that you have refered to the specified dlls in your project.

I hope this information helps. If you need any further assistance, please don't hesitate to contact me. 

0
Ryan
Top achievements
Rank 1
answered on 11 Nov 2013, 09:23 PM
<script type="text/javascript">
    function onDblClick(sender, eventArgs) {
        __doPostBack("<%= ReportPivotGrid.UniqueID %>", "RowDoubleClicked:" + eventArgs);
    }
</script>
I am catching the Double Click Event, but am not certain how to get the current Index, when using a Rad Grid the command would be

get_itemIndexHierarchical

What argument does the PivotGrid require?
0
Dimitar
Telerik team
answered on 14 Nov 2013, 08:13 AM
Hello Ryan,

Thank you for contacting Telerik support.

I think that you have posted your question in a wrong forum because this thread is for RadPivodGrid for WinForms. I want to kindly ask you to post your question in the appropriate forum section. This way you will receive proper answer to your question.

Thank you in advance for your patience and cooperation.  

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
PivotGrid and PivotFieldList
Asked by
Ercument Berktas
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or