I am using v2018.1 & VS2019 I have a wingrid tied to a dataset. I add new columns to the dataset and they show in the designer. But when I run the program they aren't visible. The new columns hidden property is false. What do I need to do to get the columns to show up?
Thanks
Steve
Hello,
Thank you for posting on our forums.
When do you add the new columns? If it is on runtime, do you have any change detection for your data source?
Or if you add them before you build the app, the new columns are not added to the data source and the grid loads the old one?\
Looking forward to your reply.
Sincerely,
Tihomir TonevAssociate Software DeveloperInfragistics
I changed the select sql statement for the table in the dataset designer. the table shows the new columns. when i then switch back to the ultragrid designer the new columns show up. when i then build/run the project they don't show.
Thank you for your reply.
At some point in your code you should probably have the following line:
this.ultraGrid1.DataSource = collection coming from SQL statement;
Is this collection updated with the new statement? Because if it is not, it will not be reflected when you build your app.
Here’s the code. The grid should change based on the new columns added to the data table.
Me.ugShippingLabelData.DataMember = "ShippingLabelData"
Me.ugShippingLabelData.DataSource = Me.Ds1
The grid works properly in that it shows data from the dataset table for the existing columns as below
However, the current design of the grid in the grid designer looks like this
So the issue is why doesn’t the runtime grid look like the designtime grid? Obviously the grid designer sees the new columns. it's like the build isn't looking at the new design of the grid. How can that be?
When do you call the select statement?
You assign .DataSource to .Ds1, but what is in .Ds1 at that point?
If Ds1 is a collection that implements INotifyPropertyChanged, when the select statement resolves, the grid will update. If it does not, and it takes some time for the server to respond, the grid won't know that the data has been updated and it will not show the new data.
Before I display the grid I use a tableadapter to fill the data table. As I've said the data in the grid is correct. it displays the rows in the data table.
Why do the columns as showing in the designer within VS not get built? When I build/run the project why does the old format of the grid show? Is there a file that the designer generates that could possibly not get recreated when I change the column format? The problem seems to be with the build process and not the execution (i.e. when the select statement is issued).
Glad to hear that the issue has been resolved.
Thank you for using Infragistics components.
SIncerely,
I just found the problem and it is ourselves. I didn't realize the program was manipulating the grid columns before displaying it. Sorry for my stupid error.
Do you create layout for the grid?
In cases where you would just add data source without defining layouts, the grid will update anytime the data source updates.
Is it possible to create a sample where I can test this and see what might be wrong?