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.

Display full text in GridTextBoxCellModel

Thread ID:

Created:

Updated:

Platform:

Replies:

44944 Jun 7,2006 10:17 AM Jun 8,2006 04:21 AM Windows Forms 2
loading
Tags: GridControl
Christian Lützenkirchen
Asked On June 7, 2006 10:17 AM

Hi, I am using a custom cell like EllipsisCell from from the sample Essential Studio\4.2.0.37\windows\Grid.Windows\Samples\In Depth\CellButtons\CS in a Syncfusion.Windows.Forms.Grid.GridControl runnig in virtual mode. I am using GridShowButtons.ShowCurrentCell. This works fine except that the text of a cell always shows space for the buttons (in my application two or three buttons) even then they are not shown. I deleted the line innerBounds.Width -= 40; in GridTextBoxCellRenderer.OnLayout and the text is shown in the whole cell but my buttons are overwritten by the text. How can I set the inner bounds to another value when buttons are shown and not shown? Regards, Christian

Administrator [Syncfusion]
Replied On June 8, 2006 01:37 AM

Hi Christian, You need to check the current cell for detecting the cell button visbility of the cell with GridShowButtons.ShowCurrentCell option in a grid. Here is a code snippet. /// protected override Rectangle OnLayout(int rowIndex, int colIndex, GridStyleInfo style, Rectangle innerBounds, Rectangle[] buttonsBounds) { TraceUtil.TraceCurrentMethodInfo(rowIndex, colIndex, style, innerBounds, buttonsBounds); // Here you specify where the button should be drawn within the cell. Rectangle rightArea = Rectangle.FromLTRB(innerBounds.Right-20, innerBounds.Top, innerBounds.Right, innerBounds.Bottom); buttonsBounds[0] = GridUtil.CenterInRect(rightArea, new Size(20, 20)); // Here you return the area where the text should be drawn/edited. //To Check the button shown or not shown. if( style.ShowButtons == GridShowButtons.ShowCurrentCell || style.ShowButtons == GridShowButtons.ShowCurrentCellEditing ) { // For ShowCurrentCell option button show after click the cell. if( rowIndex == this.CurrentCell.RowIndex && colIndex == this.CurrentCell.ColIndex) { innerBounds.Width -= 20; //For button shown } } else if ( style.ShowButtons == GridShowButtons.Hide ) innerBounds.Width -= 0; else innerBounds.Width -= 20; return innerBounds; } Let me know if this helps. Regards, Haneef

Christian Lützenkirchen
Replied On June 8, 2006 04:21 AM

Hi Haneef, your sample works fine. Thank you very much for your help! Regards, Christian

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.

;