I have a complicated query with a bunch of different inputs. I was wondering if its possible to have the grid update when the dataset gets changed. IE like how ive written it below.
public DataSet dsGrid = null;
public void FillGrid(int groupType, int groupedTrades, string xmlLayout){
dsGrid = runQuery();
if (ultraGridTradeTagger.DataSource == null) ultraGridTradeTagger.DataSource = dsGrid.Tables[0];
}
duplicate post
for some reason the dataset doesnt get updated. The refresh grid method is running a sqlhelper.executedataset command to its creating and returning a new dataset thus even though the grid is binded to a dataset the contents of the dataset are a new object I am assuming and thats why it isnt updating?
Hi,
I don't understand your question. If you bind the grid to a DataTable, which you seem to be doing here, then any changes you make to that DataTable will automatically be displayed in the grid. The DataTable sends a notification when something changes and the grid receives this notification and updates the display. You don't have to do anything.