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

Grid cell doesn't respect float settings when GridCellTextBoxRenderer.TextBox text is changed

Hello everyone! First of all, I'm sorry for the confusing title, but there is no simple way of describing my problem. 

Here's what's happening: I use a GridControl with pretty much everything customized, including the formula mechanism, which uses the Syncfusion calculation engine but needs to store the values and handle the cell values in a different way than the grid provides. 

One of the things I need to implement is that, when the user presses F2 or even double-clicks the cell, I have to replace the cell value to the current formula text to enable editing. I implemented this behavior by overriding the OnBeginEdit method on my GridTextBoxCellRenderer based class and there setting the TextBox.Text property to the formula text. This works for most cases, but the problem is: my formula cells are, by default, not allowed to float (I hide the text and replace them by a sequence of "#" characters). However, when the formula text is larger than the cell's width, I needed to temporarily turn the floating behavior on so the user can see the whole content of the formula without needing to navigate through a tiny TextBox. I've attached some images of what I wish to implement.

What I need to do when the user presses F2 (this only happens before I create the formula)

What I need to do when the user presses F2

The formula cell, after calculated



What happens when I press F2 (I realize this happens because of the floating cell mode, but I'm guessing if there is someway of turning it off while I'm editing the cell)



Thanks in advance,
Rodrigo

1 Reply

VS Venkatesh Sundaram Syncfusion Team July 13, 2016 05:51 AM UTC

Hi Rodrigo ,   
 
Thank you for the update.   
 
If you want to enable the floating cells to the GridControl, use the FloatCellsMode property. Please refer to the following code example in that code is used to enable the floating cells.      
 
this.gridControl1.TableStyle.FloatCell = true;  
[OR] 
this.gridControl1.FloatCellsMode = GridFloatCellsMode.OnDemandCalculation; 
 
Refer to the link below for more information about Floating.     
  
Regards,   
Venkat.

Loader.
Up arrow icon