ListView in a UserControl



Hello,


I'm creating a control including a listview. I would like to be able to
set the columns through the Design Tool in Visual Studio, so I created a
parameter to access the columns of my listview:

private ListView.ColumnHeaderCollection myColumns
{
get
{
return(this.myListView.Columns);
}
set
{
this.myListView.Columns.Clear();

foreach(ColumnsHeader column in value)
{
this.myListView.Columns.add(column);
}
}

Of course this is not working, I can insert my columns in the designer,
but when I launch my application, the collection is empty. I'm sure what I
did is dirty, but I don't know what to do... If someone has a clue...

Thank !

Laurent


.



Relevant Pages

  • RE: listview vertical scrollbar width
    ... ListView control encapsulates Windows build-in List-View to leverage its ... Windows has two kinds of scroll bars. ... You may use Spy++ to view ListView control structure and its windows style ... considered the non-client area of ListView, so this WS_VSCROLL scrollbar is ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: ListView vs CheckListBox
    ... The application UI has a List View control and a Text Box and a Button. ... list view displays a list of files with checkboxes besides each file name. ... ListView.CheckedListViewItemCollection checkedItems = ... > is displayed with in my ListView, ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Autosizing Listview Columns
    ... > width of the columns after populating listview with items. ... The native listview control was design in such a way that, ... > PInvoke correctly resizes the columns, the other 3 regions all don't work ... > | private static extern int GetFocus(); ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Listviw SHOWSELALWAYS
    ... The ListView control has a HideSelection property which defaults ... > LVS_SHOWSELALWAYS is not an extended style, ... > Private Sub Form_Click ...
    (microsoft.public.vb.controls)
  • Re: Listviw SHOWSELALWAYS
    ... The ListView control has a HideSelection property which defaults ... LVS_SHOWSELALWAYS is not an extended style, ... Dim lStyles As Long ...
    (microsoft.public.vb.controls)

Loading