0

I am using Infragistics UltraWebGrid. I've handled its InitializeDataSource event with a function that fills the grid's DataSource property. Great. That works. When the grid determines that it needs data it goes and gets it.

My issue is that there are times where, because of actions taken on the page, I need to go back to storage and get new data. When I do this supplying the data I want to use to the DataSource property and then calling DataBind nothing happens. The grid does not bind itself to its DataSource.

Is there an incantation of code that will force UltraWebGrid to bind to its DataSource while still handling the InitializeDataSource event?

Jeff King
  • 243
  • 3
  • 7
  • 1
    Does it work if you set the DataSource to null call DataBind, set the DataSource to the updated list and then call DataBind? If that doesn't work, what event(s) do you have this logic in? – alhalama Feb 23 '12 at 01:05
  • **Steve**: The source code for the page is over 500 lines. It will take me some time to reduce it to it's essentials for this issue. **alhalama**: No, setting the DataSource to null then calling DataBind has no effect. I am trying to do this logic in a button click that is outside of the grid. – Jeff King Feb 23 '12 at 02:31

1 Answers1

2

Thanks for the suggestions. I ended up find the solution (with a little help from a co-worker). Here is the code (sorry for the VB):

grid.DataSource = Nothing
grid.DataBind()
grid.Clear()
grid.DataSource = theNewDataSource
grid.DataBind()

Apparently you need to reset the DataSource and call Clear before setting the DataSource to your desired source and calling DataBind().

Jeff King
  • 243
  • 3
  • 7