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.

Allowing new lines in DataBoundGrid Paste

Thread ID:





6533 Aug 15,2003 08:47 AM Aug 15,2003 08:54 AM Windows Forms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On August 15, 2003 08:47 AM

Hi, I have a data bound grid. I would like the user to paste any text into the TextBox cell. This text may contain new line characters. How do I allow that? thanks, - Reddy

Administrator [Syncfusion]
Replied On August 15, 2003 08:54 AM

Nevermind. I got it to work by using the DBG Model ClipboardPaste event. I was looking for that event in the grid. For regular Grid Control it was there in the Grid. For DBG, it is there in the model. thanks, - Reddy ----------------------------------- private void queryDBGModel_ClipboardPaste(object sender, GridCutPasteEventArgs e) { GridCurrentCell cc = queryDBG.CurrentCell; int row = cc.RowIndex; int col = cc.ColIndex; IDataObject iData = Clipboard.GetDataObject(); string str = iData.GetData(DataFormats.Text) as string; if(queryDBG[row, col].CellType == "TextBox") { cc.Renderer.Paste(); } e.Handled = true; }


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.