Dear All,

How can I add items of Text to a list control in report view to columns other 1?

I thought the Item and iSubItem fields of LVITEM would fill in this information for me, but I can not get this to work.

Any thought's or the correct solution I would be grateful.

Regards
Jason.




// Taken from Header File. MFC Generated Code
public:
CLotteryDlg(CWnd* pParent = NULL); // standard constructor
CHeaderCtrl *m_Header;

// Dialog Data
//{{AFX_DATA(CLotteryDlg)
enum { IDD = IDD_LOTTERY_DIALOG };
CListCtrl m_Results_List;
//}}AFX_DATA



//Taken from my OnInitDialog

LVITEM jb2;
ZeroMemory(&jb2,sizeof(jb2));

jb2.mask=LVIF_TEXT;
jb2.iItem=1;
jb2.iSubItem=0;
jb2.pszText="Jason";
jb2.cchTextMax=20;


m_Results_List.InsertColumn(0,"Date",LVCFMT_CENTER,100,-1);
m_Results_List.InsertItem(&jb2);

m_Results_List.InsertColumn(0,"1",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(2,"2",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(3,"3",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(4,"4",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(5,"5",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(6,"6",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(7,"B",LVCFMT_CENTER,20,-1);
m_Results_List.InsertColumn(8,"Machine",LVCFMT_CENTER,70,-1);

jb2.iItem=2;
jb2.iSubItem=1;
jb2.pszText="help";
m_Results_List.InsertItem(&jb2);

m_Results_List.UpdateWindow();

// The result is that Only "Jason" gets added to Column 0 of the View.

[email protected]

please delete between the '-' cheers.