Shoutbox

Listview issues - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Listview issues (/showthread.php?tid=63710)

Listview issues by Mothuim on 07-21-2006 at 01:59 AM

I'm trying to add a listview control to my script. I can get it to fill in the first column perfectly but nothing else. i found this thread which seemed to be the same problem as mine. But i'd like to know why my method does not work. Specifically what the columnidx should be.

Here's my code:

code:
for (i = 1; i < NodeCol.length; i++)
   {xSMC = NodeCol.item(i).text
   xEmail = NodeCol.item(i).getAttribute("Contact")
//Create item
     OptionsWnd.LstView_AddItem(
    "ListViewMC",
    xEmail,
    i,
    i
);

//Set item texts
OptionsWnd.LstView_SetItemText(
    "ListViewMC",
    i,
    columnidx,
    xSMC
);
     
     
     }


I've tried a few obvious ideas like 0, 1 , 2 etc but nothing....

EDIT: I've also tried playing with the columnid value which is set in the interface xml but that didn't work either.
RE: Listview issues by Volv on 07-21-2006 at 07:57 AM

Columnidx should be either 0 (first column), 1 (2nd column), 2, 3 etc.

Your ListView control in your XML file should also follow a similar format;

code:
<Control xsi:type="ListViewControl" Id="lstContacts">
    <Position Top="20" Width="326" Left="12" Height="162"></Position>
    <Attributes>
        <AlwaysShowSelection>false</AlwaysShowSelection>
    </Attributes>
   
    <ReportView>
        <SortColHeader>true</SortColHeader>
        <HasCheckboxes>true</HasCheckboxes>
    </ReportView>
    <Columns>
        <Column>
            <ColumnId>colEmail</ColumnId>
            <Label>Email</Label>
            <Width>30</Width>
        </Column>
        <Column>
            <ColumnId>colName</ColumnId>
            <Label>Nickname</Label>
            <Width>71</Width>
        </Column>
       
    </Columns>
   
</Control>

In this example colEmail would be the first column (ie. columnidx = 0) and colName would be the 2nd column (ie. columnidx = 1)