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.

clip board function (not used) option

Thread ID:

Created:

Updated:

Platform:

Replies:

96045 Aug 18,2010 02:07 AM Sep 1,2010 12:35 AM WPF 5
loading
Tags: GridControl
jungjin Park.
Asked On August 18, 2010 02:07 AM

syncfusion GridDataControl (v8.304.0.21)

I want not to use a clip board function.
Is it possible? Cannot seek a the method.
Must use Ctrl + C( and V ) Key press.
but it is impossible because of clipboard function.
Uses inputBinding functions.












Muthulakshmi N [Syncfusion]
Replied On August 25, 2010 07:31 AM

Hi Park,

Thank you for your details.

Here we have prepared a sample which illustrates your request. Please download the sample from the below location.

Link: http://www.syncfusion.com/uploads/redirect.aspx?file=GDCRoutedCommand_dfffa985.zip&team=development


[C# Code]

public static RoutedCommand CopyCommand = new RoutedCommand();

CommandBinding cb = new CommandBinding(CopyCommand, CopyCommandExecute, CopyCommandCanExecute);
this.CommandBindings.Add(cb);


private void CopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}

private void CopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
{
if (e.Parameter.ToString() == "opencommand")
opencommand();
}

public void opencommand()
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
}

Let us know if you need any details.

Thanks,
Muthulakshmi

jungjin Park.
Replied On August 26, 2010 02:04 AM

Hello~

Thanks for your reply.
I added Ctrl + v and Ctrl + c in your sample.

1. Xmal.






2. C# code.
private void CopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
{
if (e.Parameter.ToString() == "opencommand")
{
opencommand(); => event occur. (usable)
}
else if (e.Parameter.ToString() == "copycommand")
{
opencommand(); => event does not occur. (not enabled : Ctrl + c)
}
else if (e.Parameter.ToString() == "pastcommand")
{
opencommand(); => event does not occur.(not enabled : Ctrl + v)

}
}


I want to control Ctrl + C and Ctrl + V.

Thank you.





GDCRoutedCommand_dfffa985_1_2c6a49e3.zip

Muthulakshmi N [Syncfusion]
Replied On August 30, 2010 04:33 AM

Hi park,

Thank you for your details.

Here we have prepared a sample which illustrates your request. Please download the sample from the below location.

[C# Code]

CommandBinding cb = new CommandBinding(CopyCommand, CopyCommandExecute, CopyCommandCanExecute);
this.CommandBindings.Add(cb);
KeyGesture kg = new KeyGesture(Key.C, ModifierKeys.Control);// KeyGesture kg = new KeyGesture(Key.V, ModifierKeys.Control);
InputBinding ib = new InputBinding(CopyCommand, kg);
this.InputBindings.Add(ib);

textBox.CommandBindings.Add(cb);
textBox.InputBindings.Add(ib);

dataGrid.ModelLoaded += (s, e) =>
{
dataGrid.Model.Grid.CommandBindings.Add(cb);
dataGrid.Model.Grid.InputBindings.Add(ib);
};
}

private void CopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}

private void CopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
}


Link: http://www.syncfusion.com/uploads/redirect.aspx?file=GDCRoutedCommand_52506d37.zip&team=development


Let us know if you need any details.

Regards,
Muthulakshmi

jungjin Park.
Replied On August 30, 2010 11:58 PM

Hi~

I saw sample code.
It is a solution method which my question.

Thank you for your consideration.

Muthulakshmi N [Syncfusion]
Replied On September 1, 2010 12:35 AM

Hi Park,

Thank you for your update.

Let us know if you need any details.

Regards,
Muthulakshmi.N

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.

;