Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Fired events when binding datatable changed

Fired events when binding datatable changed

New Discussion
Adeyinka Majekodunmi
Adeyinka Majekodunmi asked on Jan 29, 2016 11:15 AM

I have a dashboard using an ultragrid bound to a datatable that is updated at runtime by a process. The grid displays the updated informatoin as it is bounded to the datatable.

Now I want to format the cell colour and font of the updated cell but can't seem to find the event relating to this. There is no user input so I cannot use the stock events

Sign In to post a reply

Replies

  • 0
    Adeyinka Majekodunmi
    Adeyinka Majekodunmi answered on Jan 28, 2016 3:10 AM

    Okay I found the initializeRow event to do the trick. However I cannot find out which cell has changed. Any ideas?

    • 0
      Milko Venkov
      Milko Venkov answered on Jan 28, 2016 9:42 AM

      Hello Adeyinka,

      Thank you for posting in our forum.

      If I understand you correctly you need to determine when the data in the DataTable was changed by the back end data base. Please note, the grid does not deal with the data base directly. It is only deal with the local data source, e.g. DataTable in your case. So there is no event in the grid which may fire when the back end data base changes some data in the DataTable. So you need to track the changes in the DataTable and not in the grid. You may use RowChanging or ColumnCnahging events of the DataTable class for this.

      Please let me know if you need any additional information.

      Thank you for using Infragistics Controls.

      • 0
        Adeyinka Majekodunmi
        Adeyinka Majekodunmi answered on Jan 28, 2016 11:22 AM

        What i need is to be  notify when data in a cell has changed. When the datatable is updated, the grid update automatically due to binding but the only event that fires is InitializeRow and this has no infotmation on the column or cell that has changed. There is no user intervention in my application as it is a display board.

        I have worked around this by tracking column changed in the datatable and passing the column to the e.row(ChangeColumn) of the InitializeRow so it knows which cell to format. This isn's ideal as I have to filter out other triggers of this event and i believe it is very costly on resources.

      • 0
        Adeyinka Majekodunmi
        Adeyinka Majekodunmi answered on Jan 28, 2016 11:23 AM

        I also cannot see any events called RowChanging or ColumnChanging.

      • 0
        Dimitar
        Dimitar answered on Jan 29, 2016 11:15 AM

        Hi,

         

        Thank you for the reply.

         

        InitializeRow is the only event that fires if a value in the underlying data source has changed. The other events related to updating the data in the grid, like BeforeRowInsert, CellChanged, etc., are fired only if the interaction happens through the grid, not through the data source. So in order to achieve your requirement you will have to use the IntializeRow event and in order to know which cell was changed you need to track it through the underlying data source. For this you can use the ColumnChanging event of the DataTable bound to the grid. In that case you will need to filter only the changes you need to reflect in the actual grid, but as for performance, I don’t believe it will be that taxing as this is simply an additional event.

         

        Please let me know if you have any additional questions.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Adeyinka Majekodunmi
Favorites
0
Replies
5
Created On
Jan 29, 2016
Last Post
10 years, 7 months ago

Suggested Discussions

Tags

Created on

Jan 29, 2016 11:15 AM

Last activity on

Jan 29, 2016 11:15 AM