Adding column in listview present in splitcontainer

Jun 8 2010 12:27 AM
Hi everyone,

I have created a split-container which has two panels : panel1 and panel2.
In panel2 i have placed a list-view which will show the data fetched from database.
the problem is that i am not able to access list-view since it is present in split-container means I am not able to add column in the list view at runtime( i.e through coding and not at design time) due to which i can't import any data from database.

 this.listView1.Columns.Add(new ColumnHeader());
this.listView1.Columns[0].Text="Name";

I have written the above code but it seems that it is not sufficient to add any column in the list-view since it is present in the split-container.

if anyone knows the solution to it then plz post it as soon as possible.

Thanks in advance.