Table.LoadXML and column width setting

mjcoon

Well-Known Member
Licensed User
I have a program that shows data in a table and uses two views of the table with most of the columns visible (one is not meant for viewing) or a subset.

I allow the data to be saved and restored via CSV or XML formats.

When restoring from XML I find that all the column widths which were set by AddCol() or subsequently by ColWidth() = are now set to some default value (so that even the column meant to be invisible can be seen).

Perhaps this is just a side effect of LoadXML (though I cannot see why this should not be a bug). So I expected to get round it just by using the code that already works in reverting from subset to full viewing. But I find that after LoadXML the ColWidth() = code no longer works at all!

I attach a zipped source with two example data files in CSV and XML format. You will see that it works fine under the desktop IDE with either CSV or XML. But when compiled the fault appears.

Mike.
 

Attachments

  • TestLoadCSV.zip
    2.4 KB · Views: 229

agraham

Expert
Licensed User
Longtime User
Succinctly the problem is, when compiled, once a table has been loaded by LoadXml none of the columns can have their width set programatically even when the table is subsequently reloaded by LoadCSV. In the IDE there is no problem. All this is on the desktop.

I see this behaviour consistently but am at a loss to explain it (which probably means it is something simple but I don't really understand the .NET data controls!). Poking round with Reflector I can see no significant differences between the IDE code and the compiled code.
 

mjcoon

Well-Known Member
Licensed User

Hi Erel, that's fair enough, I have no real need to use XML at all.

Is there any possibility of having column heading texts separate from the column names used in the code?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…