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.

Excel Like Copypaste to clipboard in Gridgroupingcontrol

Thread ID:

Created:

Updated:

Platform:

Replies:

75900 Aug 14,2008 02:26 AM Aug 14,2008 06:40 AM Windows Forms 1
loading
Tags: GridControl
Sumit Jha
Asked On August 14, 2008 02:26 AM

I am using Gridgroupingcontrol. I want to implement excel type cut-copy feature in the control.
When I am using this.m_adminDataGridViewControl.TableOptions.AllowSelection = GridSelectionFlags.None;
It doesn't allow to select individual cells .
When I am using

this.m_adminDataGridViewControl.TableOptions.AllowSelection = GridSelectionFlags.Any I am not able to get selected records.


Jisha Joy [Syncfusion]
Replied On August 14, 2008 06:40 AM


HiSumit,

We appreciate your interest in Syncfusion Products.

If you have the inherited GridControlBase selection(GridSelectionFlags.Any), by setting the ListBoxSelectionMode to none. Then, you could use the code below to get the selected rows and the number of selected rows. The grid.TableControl.Model.SelectionChanging/SelectionChanged are the events that get triggered when doing selections.

this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.None;

GridTableControl tc = this.gridGroupingControl1.TableControl;
if (tc.Selections.Ranges.ActiveRange.IsRows)
Console.WriteLine("No of rows selected: {0}", tc.Selections.Ranges.ActiveRange.Height);

GridRangeInfoList rangeList = tc.Selections.GetSelectedRows(true, false);
if (rangeList.Count > 0)
{
foreach (GridRangeInfo range in rangeList)
{
for (int row = range.Top; row <= range.Bottom; ++row)
{
Console.WriteLine(this.gridGroupingControl1.Table.DisplayElements[row].ToString());
}
}
}



Cut-copy feature in the control

Please refer the following browser sample:

MyDocuments\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\CutCopyPasteSample\cs


This sample allows you to perform cut, copy and paste operations with an hierarchical GridGroupingControl. In this sample, the gridgroupingcontrol is bound to an hierarchical dataset comprising of two tables. A Context Menu is associated with the grouping grid to enable the required clipboard operations.

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.

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.

;