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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Re:store multiple line in a bound grid

Thread ID:





44705 Jun 1,2006 06:57 AM UTC Jun 2,2006 11:36 AM UTC WinForms 5
Tags: GridControl
Asked On June 1, 2006 06:57 AM UTC

My problem is i have a bounded grid.In the code when click on the button it will popultate the new screen and there i type some comments and when i save the button that comments will be stored in the grid control. The problem is when i type multiple lines that information will be stored in the grid control.But when i move to another row and return to the same row and click on the button it will display the first line contents only. please help me.


Administrator [Syncfusion]
Replied On June 1, 2006 08:36 AM UTC

Hi Manivannan, Could you try this code to increase the rowheight of the cell in a grid after storing the multiline text in a cell. Here is a code snippet. grdRptComments.Model.RowHeights.ResizeToFit(GridRangeInfo.Cell(i,j)); grdRptComments.RefreshRange( GridRangeInfo.Cell(i,j)); Let me know if this helps. Best Regards, Haneef

Replied On June 2, 2006 08:00 AM UTC

Mr Haneef, This code would not be helful for me to resolve my issue. I have to concerns in this grid control. 1) When the cell is in active say for eg (1,2) when i try to assign the value using Grid(1,2).Text = <> It throws an exception such as "Object Reference has nothing." 2) when i store the value grdRptComments.Model.CurrentCellInfo.CellView.ControlText = retComment grdRptComments(i, j).Text = grdRptComments.Model.CurrentCellInfo.CellView.ControlText but controltext hold the very first line it will not accept the next line characters. in my scenario retcomment has some strings with multiple lines. when i try to assign the retcomment value to controltext it will accept the very first line from retcomment why? Pls help me to reslove this issue. --Mani

Administrator [Syncfusion]
Replied On June 2, 2006 09:40 AM UTC

Hi Manivannan, For this problem, you can try this code grdRptComments.CurrentCell.Renderer.Control.Text = retComment instead of this code grdRptComments.Model.CurrentCellInfo.CellView.ControlText = retComment grdRptComments(i, j).Text = retComment Whether this works will depend upon the CellType used in the cell. Also point out the code is Renderer.Control.Text and not Renderer.ControlText. Best Regards, Haneef

Replied On June 2, 2006 10:56 AM UTC

Dear Haneef, I tried using this code grdRptComments.CurrentCell.Renderer.Control.Text = retComment it won''t help for me. Still i am facing the same problem it accepts the very first line only.

Administrator [Syncfusion]
Replied On June 2, 2006 11:36 AM UTC

Hi Manivannan, How you are trying to display a button and text in the same cell? What celltype are you using? Is it one of ours, or is it a custom celltype that you have created. Are you using unbound column or bound column? If it is bound, then the comment should be stored in the datasource (should happen automatically). Once we know the cell type, then we can prepare a little sample that uses that celltype and help you to solve the issue Thanks for your co-operation. Regards, Haneef


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon