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. Image for the cookie policy date
close icon

Re:store multiple line in a bound grid

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.

code5.zip

5 Replies

AD Administrator Syncfusion Team 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


MA Manivannan 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


AD Administrator Syncfusion Team 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


MA Manivannan 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.


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon