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

Display full text in GridTextBoxCellModel

Thread ID:





44944 Jun 7,2006 02:17 PM UTC Jun 8,2006 08:21 AM UTC WinForms 2
Tags: GridControl
Christian Lützenkirchen
Asked On June 7, 2006 02:17 PM UTC

Hi, I am using a custom cell like EllipsisCell from from the sample Essential Studio\\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 05:37 AM UTC

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 08:21 AM UTC

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


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

or the page will be automatically redirected to 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