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

Multiline at gridDataBoundGrid

Hello.
I want to know for a gridDataBoundGrid.

1. Is there any way to use multiline at a GDBG?

2. if I type 'Enter', cuser move to another cell.
Is there any way to not it to move?
(Ex. If you type Alt+Enter at excel sheet,
cuser is not move to another cell)

3. I found the link, but many link is not work.

http://www.syncfusion.com/support/forums/grid-windows/70402

Were they gone ???

1 Reply

RK Ranjeet Kumar Syncfusion Team January 20, 2010 05:15 AM UTC

Hi Chin,

Thanks for your interest in Syncfusion Products.

Q1. Is there any way to use multiline at a GDBG?
Sol.
Yes, GridDataBoundGrid does support multiline. To achieve the same you may handle QueryCellInfo event which gets fired when model queries for the style information for the specific cell.
Also use ResizeToFit method to ensure all the text entered into a cell is visible.

Q2. Is there any way to not it to move?
Sol. In order to prevent enter key movement to next cell you may set EnterKeyBehavior to none.

Please see the sample attached for its implementation.



// Event : Form1_Load

this.gridDataBoundGrid1.Model.RowHeights.ResizeToFit(range, GridResizeToFitOptions.NoShrinkSize);
gridDataBoundGrid1.Model.Options.EnterKeyBehavior = GridDirectionType.None;

// Event :
this.gridDataBoundGrid1.Model.QueryCellInfo+=new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo);

// Handler :

if(e.ColIndex==3 && e.RowIndex>0 )
{
e.Style.AllowEnter=true;
e.Style.WrapText=true;
e.Style.AutoSize=true;
}


Please find the sample attached from link mentioned below :

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=92465(Multiline_GDBG)-1791131474.zip

Regards,
Ranjeet.

Loader.
Live Chat Icon For mobile
Up arrow icon