When I put forth the question, my thought was that the control, or WE's wrapper for it, might quietly take care of the details behind the scenes--e.g., if I say, oLV.Text(3,4) = "r3c4", the control or wrapper could auto-size the Columns and Items lists to accommodate the assignment. I just (lazily, I suppose) asked before bothering to play... but that's ok, I apparently gave you some fun. :)
On Tue, Nov 03, 2009 at 02:26:28PM -0500, Aaron Smith wrote: Well, I guess we should all prepare to be surprised. You really can loop how you want to create listview items. You can add however many columns you want, however many listview items you want, and then loop through the items and populate them with whatever you want. We just tried this using Immed and a blank listview control, and it worked fine. You'll want to set the column widths to -2 so they autosize, and pay special attention to the order in which you add them -- that seems to make a difference. But it does work. Whodda thunk it? Aaron On 11/3/2009 1:54 PM, Aaron Smith wrote: >Doug, > >As long as you specify a width (explicitly or implicitly) for the >containing listview control, the control itself should take care of >sizing the column widths. > >Also, you don't have to write your dynamic XML to a file before using >it. You can pass XML data directly to the Dialog method via a string. >Take a look at the simple dialogs and message box objects in the toolkit >for examples. > >Regarding your last question, you would indeed be surprised if that >worked. So would we. Each listview item is it's own entity, so you can't >get there from here via your route. > >Aaron > >On 11/3/2009 11:37 AM, Doug Lee wrote: >>I have occasion to create a scripted dialog containing a ListView >>control which, depending on runtime circumstances, will either have no >>column headers or will have an unknown number of columns with dynamic >>names. By "dynamic," I mean they will change from one dialog creation >>to another; they will not change while one dialog is showing. >> >>This scenario obviously outrules xml specification of column headers. >>My basic question, though, is how dynamic is WE's code for positioning >>and sizing things, and when does it run? >> >>Specifics: >> >>If I don't say in xml that there will be column headers, then I create >>them at runtime, will things look out of whack on screen? >> >>Related: Would it be better to say in XML that there will be column >>headers, then turn them off in code when necessary? >> >>If spacing and sizing is worked out at dialog creation time, I'm >>wondering if I should pull the crazy stunt of writing out a dynamic >>xml file and then using that to open the dialog. I doubt this is >>necessary, but since I won't know the column count or widths in >>advance, who knows... >> >>And one final question, though I bet I know the answer: Text items >>and subitems look writeable, but I don't suppose this means I can >>shortcut the normal red tape of inserting rows and columns a cell at a >>time with Insert calls, and just fill listview.text(i,j) as a >>two-dimensional array to populate the control? I'll be surprised if >>that one works... >> >> > -- To insure that you receive proper support, please include all past correspondence (where applicable), and any relevant information pertinent to your situation when submitting a problem report to the GW Micro Technical Support Team. Aaron Smith GW Micro Phone: 260/489-3671 Fax: 260/489-2608 WWW: http://www.gwmicro.com FTP: ftp://ftp.gwmicro.com Technical Support & Web Development -- Doug Lee, Senior Accessibility Programmer SSB BART Group - Accessibility-on-Demand mailto:[email protected] http://www.ssbbartgroup.com "While they were saying among themselves it cannot be done, it was done." --Helen Keller
