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

How to hide cell contents?

Hello everybody

I have next issue in gridGroupingControl:
When starting editing of a cell (from ONE specific column), I need to hide cell contents and only show user what he enterred, and then (when value entering is finished) append enterred value to previous value and show it all.

I tried to do it through operations with a datasource, but met a problem that setting any value to a datasource makes focus leaving cell and accepting enterred data.

Thanks for your help!

2 Replies

AD Administrator Syncfusion Team September 11, 2006 12:55 PM UTC

Hi Konstantin,

You can handle the TableControlCurrentCellStartEditing to get the Old text before editing the cell and handle the TableControlCurrentCellEditingCompleteto to set the combined text to the cell. Below is a code snippet.

string currentValue = string.Empty;

private void TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
currentValue = e.TableControl.Model[cc.RowIndex,cc.ColIndex].Text;
cc.Renderer.ControlText = string.Empty;
}

private void TableControlCurrentCellEditingComplete(object sender, GridTableControlEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
e.TableControl.Model[cc.RowIndex,cc.ColIndex].Text = currentValue + e.TableControl.Model[cc.RowIndex,cc.ColIndex].Text;
}

Let me know if this helps.
Best Regards,
Haneef


KB Konstantin Babiy September 12, 2006 10:25 AM UTC

Thank you Haneef, that really helped me!

Loader.
Live Chat Icon For mobile
Up arrow icon