Grid won't refresh when data in database is changed

Posts   
 
    
simonuser
User
Posts: 9
Joined: 29-Nov-2006
# Posted on: 31-May-2007 17:05:17   

I am using Infragistics UltraGrid .Net 1.x in a Windows app. When the grid is displayed, it has all the correct records, but when I change one of those records at the database level, the change is not reflected in the grid. What is the correct approach to this?

        Dim sDate As Date = DTPickerOrderDate.Value.Date
        Dim eDate As Date = sDate.AddDays(1)

        Dim Entities As New OrdersCollection
        Dim Sorter As New SortExpression(New SortClause(OrdersFields.OrderDate, SortOperator.Descending))
        Dim Filter As New PredicateExpression
        Filter.Add(New FieldCompareValuePredicate(OrdersFields.Account, ComparisonOperator.Equal, HFACCOUNT))
        Filter.Add(New FieldCompareValuePredicate(OrdersFields.OrderDate, ComparisonOperator.GreaterEqual, sDate))
        Filter.Add(New FieldCompareValuePredicate(OrdersFields.OrderDate, ComparisonOperator.LesserThan, eDate))

        Entities.GetMulti(Filter, 0, Sorter)

        UltraGrid1.DataSource = Entities
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 01-Jun-2007 08:55:59   

but when I change one of those records at the database level, the change is not reflected in the grid.

I'm not sure what do you mean, here. Would you please elaborate here? Please mention in steps the process to re-produce the issue.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39914
Joined: 17-Aug-2003
# Posted on: 01-Jun-2007 11:22:54   

You have to refetch the data of course. You refetched the data into a collection that's bound to the grid?

Frans Bouma | Lead developer LLBLGen Pro
simonuser
User
Posts: 9
Joined: 29-Nov-2006
# Posted on: 01-Jun-2007 21:06:21   

Otis wrote:

You have to refetch the data of course. You refetched the data into a collection that's bound to the grid?

Of course, I don't know what I was thinking. Thanks.