Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
Edit a cell's value somewhere?
posted

In Excel, if we click on a cell, the cell is select, but the cell doesn't enter the edit mode,

we can see the cell's value appears on the top of the sheet's header(the control looks like a Textbox,

now i just consider it as a Textbox), then we can edit the value here. The effect is the same as we directly

edit the cell by double clicking the cell.

Does the WinGrid also provide such a Textbox on the top of the header let us edit the cell's value

in such a way?

here is a demo picture about this solution

Thanks  

  • 37774
    posted

    There is nothing built into the grid that would allow this.  You could certainly bind an external editor to the ActiveCell of the grid, such as:

    private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
    {
        this.textBox1.DataBindings.Clear();

        UltraGridCell cell = this.ultraGrid1.ActiveCell;
        if (cell == null)
            this.textBox1.ReadOnly = true;            
        else
        {
            this.textBox1.DataBindings.Add("Text", this.ultraGrid1.DataSource, cell.Column.Key);
            this.textBox1.ReadOnly = false;
        }
    }

    You would also want to set the grid.DisplayLayout.Override.CellClickAction to CellSelect, and also set the AllowUpdate to False if you want to exclusively provide editing through the external control.

    -Matt