Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / On CellChange event of an UltraGrid, why is the new value not immediately returned?

On CellChange event of an UltraGrid, why is the new value not immediately returned?

New Discussion
David Hooley
David Hooley asked on Sep 14, 2016 5:29 PM

When using an UltraGrid, I have a checkbox style column which represents a boolean value in the database. When I click this cell, to set the value to ‘True’, the grid is supposed to show additional columns that were previously hidden. However, these columns do not appear until changing the value of another cell after setting the ‘True` value, and after stepping through the code, I can see that once I have set the value to ‘True’, and the relevant If statement is reached, the value is still returning as ‘False’, until after I’ve changed another cells value, as I mentioned.

Why is this the case? Is there a way around it?

Sign In to post a reply

Replies

  • 0
    Sahaja Kokkalagadda
    Sahaja Kokkalagadda answered on Sep 12, 2016 10:43 PM

    Hi David,

    Value is not updated to “True” because the cell is still in edit mode. CellChange event fires for every keystroke and the only way for Grid to know that user is done with editing is when he leaves the cell.  So Grid will update the Value only after user leaves that cell.

    If you want to show additional columns immediately after user changes the Value then try calling Update method off your Grid in CellChange event. For example you can do something like this.

    private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
            {         
                this.ultraGrid1.Update();
            }

    Please let me know if I may be of further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer

    • 0
      David Hooley
      David Hooley answered on Sep 13, 2016 11:34 AM

      Hi, 

      I tried using this at the very top of the CellChange event (UltraGrid.Update(), since I'm in vb.net), but the columns still didn't appear until after I change a different columns value.

      • 0
        Sahaja Kokkalagadda
        Sahaja Kokkalagadda answered on Sep 13, 2016 4:11 PM

        Hi David,

        I’m showing my hidden column as soon as the CellChange event fires in which case Grid.Update works. But as your show/hide logic is based on the value of cell you need to call Update method on the active row to render this change without leaving the active cell. For example:
        this.ultraGrid1.ActiveRow.Update();

        After further research I found this link where a similar issue is previously answered. As suggested in this post I recommend using Text property of the cell to show/hide your columns.

        http://ko.infragistics.com/community/forums/p/5375/24291.aspx#24291

        Please let me know if you have any questions.

        Sincerely,
        Sahaja Kokkalagadda
        Associate Software Developer

      • 0
        David Hooley
        David Hooley answered on Sep 13, 2016 5:10 PM

        Hi Sahaja,

        How would this be done using the Text property? 

      • 0
        Sahaja Kokkalagadda
        Sahaja Kokkalagadda answered on Sep 14, 2016 5:29 PM

        Hi David,

        To achieve this, Please refer to the attached sample which demonstrates how to show/hide a column based on the text of the active cell.

        Sincerely,Sahaja KokkalagaddaAssociate Software Developer

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
David Hooley
Favorites
0
Replies
5
Created On
Sep 14, 2016
Last Post
9 years, 5 months ago

Suggested Discussions

Tags

Created by

Created on

Sep 14, 2016 5:29 PM

Last activity on

Feb 12, 2026 3:34 PM