I have a DataTable bound to a xamdatagrid in the xaml and a picker that lets them select an item and its associated datatable to configure. There is a field chooser and they can use it to set up a customization (including visibility) and I am saving that as a string with the setup to use later on.
I am using it to save different customization strings for different views for reports based off of the same base table. I show them just a sample of 100 records.
How can I refresh the datatable on my bound xaml when they refresh the table to setup a new customization from the picker. clearcustomizations doesn't seem to do it.
I tried setting the datasource to null before picking up the table again.
The new pick and bind displays with the visibility set to the previous view of the table they had setup the customization for.
HI,
How are you filing your datatable? If you need to refresh the DataTable you can call the DataSet's TableAdatper and call one of the Fill methods.
The XamDataGrid should refresh automatically.
the datatable is getting declared (new) and refilled. it is part of a grid control with a field chooser sitting there as well. if I load a customization string the table picks that up from the get go. If I have no customization string to load (for example they have not configured how they want this version of the table display to look) then a clear of the customizations and then the instantiation and fill of the datatable still displays with the prior customization. Once you click on the field chooser it will display the table correctly with all fields (no customization set). I can't really make the user click on the field chooser to refresh tho....just not the way it should work.
I tried
_dp.ClearCustomizations(CustomizationType.All);
but that didn't work...I don't think I can listen for field initialized or field chooser opening either...that'd be to late after the datatable binding I think. ?
Wondering if I could hack up an emptyish customization string to load or something? I just want all the fields and their normal order to display when a new iteration of the table is picked to be configured.
Hi,
Can you attach a small isolated sample using the NorthWind Access DataBases for me to review?
Please let me know if you need further assistance regarding this issue.