![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi Peeps,
Setting columnwidth in a table (TblD) in this code is does not work: All columns stay equally wide..... ![]() bestandsnaam="\Opslagkaart\rmsgolf\rmsafstanden.xm l" TblD.LoadXML(bestandsnaam) TblD.ColWidth(TblD.ColName(0))=65 TblD.ColWidth(TblD.ColName(1))=65 TblD.ColWidth(TblD.ColName(2))=35 TblD.ColWidth(TblD.ColName(3))=150 TblD.Visible=True TblD.Refresh FrmGem.Refresh Any suggestions anyone??? |
|
|||
|
I've only used LoadCSV() (and with no header embedded in the file), so I don't have experience of the detail of LoadXML(), but I see that it sets up the column types and presumably the names. Have you confirmed that there are names? Would the code behave as you see if the names were null?
(I've just added a SaveXML() to my code in addition to the SaveCSV(), and I see that the XML has the column names but not the widths.) I haven't had a problem with changing a column width to zero (and back) while the table is loaded... Mike. |
|
|||
|
Well,
I decided to switch to csv files and loadCSV as method. Then the width of a table is settable. So I guess it is a bug, which only is there after using method LoadXML. Answer to mjcoon: Yes there are columns; at least I see the columnheaders after loading with the correct names. Another table problem: I want to use the table object with different files, so I use: If TblD.ColCount=0 Then Return TblD.Clear For n=0 To TblD.ColCount-1 TblD.RemoveCol(TblD.ColName(n)) Next n I get errors on this code (not always) which i don't understand... Anyone got the answer? I attach code & files. You have to change the used path to the files according to your phone and make directory rmsgolf etcetera. Mike mike Last edited by rmschreuder : 01-25-2010 at 09:31 AM. |
|
||||
|
In the For - Next loop you use the variable 'n' representing the column index. After each RemoveCol the indexes of the columns change, so when for example n=TblD.ColCount-1, this column doesn't exist any more.
Try this code: For i=Table1.ColCount-1 To 0 Step -1 Table1.RemoveCol(Table1.ColName(n)) Next In the program I posted in post #5 with: For i=0 To Table1.ColCount-1 Table1.RemoveCol("Test"&i+1) Next it works because I remove the columns by their name and not by their column index. Quote:
Best regards.
__________________
Klaus Switzerland Last edited by klaus : 01-25-2010 at 09:22 AM. |
|
|||
|
Ah, of course!!!!!
Thx Klaus, now I have an error free program! I will not look into the columnwidthproblem anymore, because the xml files are larger! You certainly do deserve your awards in my opinion... Mike Last edited by rmschreuder : 01-25-2010 at 09:38 AM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Autoresize columns in table to fit Table Width | ghale | Code Samples & Tips | 1 | 07-31-2009 06:02 PM |
| Fixing a table collumn width,how? | Cableguy | Questions & Help Needed | 5 | 11-17-2008 09:43 PM |
| Is it possible to set a width of the scrollbar? | aeror | Questions & Help Needed | 2 | 06-19-2008 11:22 AM |
| Pen width and XOR drawing | enonod | Questions & Help Needed | 2 | 06-01-2008 07:43 PM |
| table col width | tvrman | Questions & Help Needed | 8 | 06-16-2007 09:41 PM |