Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I'm trying to populate the List<string> in ListView, but facing problem not at all able to populate the data.

Below giving the steps that I'm following please help.

Search on this a lot but seems its not working.<<br mode="hold" />
class Data
//using cLR properties and not a dependency property (not sure whether that causing 
//any problem)

private List<string> _pName;
      private List<string> _pNumber;
  public' List'<string>' PName
            get { return _pName; }
            set { _pName= value; }
        public' List<string> PNumber
            get { return _pNumber; }
            set { _pNumber= value; }
//Getting data in PName and PNumber accordingly by some function call

<listview selectedvaluepath="Value" name="someName" selectionmode="Single" margin="263,35,12,50">
selectionchanged="some_SelectionChanged" focusable="False" fontweight="Bold" tabindex="4">
                       <gridviewcolumn header="Person Number" width="Auto" />
                       <gridviewcolumn header="Person Name" width="Auto" />

Search on this a lot but seems its not working.

Please let me know if you need any more details.

Thanks !!
Updated 16-Dec-11 8:41am
RaviRanjanKr 16-Dec-11 14:43pm    
[Edited]Pre tag is removed from Normal texts[/Edited]

1 solution

You just didn't populate your listview
Example how to do it:

someName.ItemsSource = Data.PNumber();

You can put into the someName.ItemSource=// a special method like GetYourPNumbers()

Add to your definition of the listview someName
ItemContainerStyle="{StaticResource ItemContStyle}";
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900