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.

paste image

Thread ID:

Created:

Updated:

Platform:

Replies:

48088 Aug 18,2006 01:53 PM Aug 24,2006 03:29 AM Windows Forms 5
loading
Tags: GridControl
Marcia
Asked On August 18, 2006 01:53 PM

I want to paste a single cell. The problem that is possible paste a image in a cell. have a mode to disable this ?

thanks.

Question.zip

Administrator [Syncfusion]
Replied On August 21, 2006 01:37 AM

Hi Marcia,

You can prevent a paste by subscribing to the grid.Model.ClipboardCanPaste event and setting e.Handled = true and doing nothing in your handler.

private void Model_ClipboardCanPaste(object sender, GridCutPasteEventArgs e)
{
if( this.gridControl1.CurrentCell.RowIndex == 1 || e.RangeList.Contains(GridRangeInfo.Row(1)) )
{
e.Handled = true;
e.Result = false;
}
}

Let me know if this helps.
Best Regards,
Haneef

Administrator [Syncfusion]
Replied On August 21, 2006 12:28 PM

Hi Haneef!!!

Thanks for your reply. But this not resolve my problem. My problem is when select something in cell and click in ctrl+c. At moment appers image.I want disable a property to paste a image in cell. Is this possible ????


steps:
-> select the text in the cell.
-> with a image in clipboard paste in cell.

thanks!!!!

>Hi Marcia,

You can prevent a paste by subscribing to the grid.Model.ClipboardCanPaste event and setting e.Handled = true and doing nothing in your handler.

private void Model_ClipboardCanPaste(object sender, GridCutPasteEventArgs e)
{
if( this.gridControl1.CurrentCell.RowIndex == 1 || e.RangeList.Contains(GridRangeInfo.Row(1)) )
{
e.Handled = true;
e.Result = false;
}
}

Let me know if this helps.
Best Regards,
Haneef

Administrator [Syncfusion]
Replied On August 22, 2006 06:22 AM

Hi Marcia,

There is no default property setting to paste a image in a cell. You need to set the CellType to InPlaceRichText and override InPlaceRichText CellRenderer''s CanPaste method. Please refer the attached sample for more details and let me know if you looking something different.

private void Model_ClipboardCanPaste(object sender, GridCutPasteEventArgs e)
{
InPlaceRichTextCellRenderer cr = this.gridDataBoundGrid1.CurrentCell.Renderer as InPlaceRichTextCellRenderer;
if( cr != null)
{
cr.Paste();
}
}

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/PasteinRichTextInPlaceCellContol_5a51719e.zip

Also refer the KB Article for InPlaceRichText CellType.
http://www.syncfusion.com/Support/article.aspx?id=10495

Best Regards,
Haneef

Marcia
Replied On August 23, 2006 01:07 PM

Hi!!

thanks for your replay again. But your code only function with "celltype" of type GridRichTextBoxCellRenderer. Others types like for example GridTextBoxCellRenderer no function. My grid`s have several types : static cells ,button cells.

Please help me !!! :)

>Hi Marcia,

There is no default property setting to paste a image in a cell. You need to set the CellType to InPlaceRichText and override InPlaceRichText CellRenderer''s CanPaste method. Please refer the attached sample for more details and let me know if you looking something different.

private void Model_ClipboardCanPaste(object sender, GridCutPasteEventArgs e)
{
InPlaceRichTextCellRenderer cr = this.gridDataBoundGrid1.CurrentCell.Renderer as InPlaceRichTextCellRenderer;
if( cr != null)
{
cr.Paste();
}
}

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/PasteinRichTextInPlaceCellContol_5a51719e.zip

Also refer the KB Article for InPlaceRichText CellType.
http://www.syncfusion.com/Support/article.aspx?id=10495

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On August 24, 2006 03:29 AM

Hi Márcia,

I am afraid that this feature is not currently supported by Essentail Grid. But you can paste a image in a cell using the InPlaceRichTextBox celltype. Please refer the below sample for more details.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/PasteinRichTextInPlaceCellContol_5a51719e.zip

Thanks for your patience.
Regards,
Haneef

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.

;