Bind data to multiple columns of WPF ListView

Need help to bind data to multiple columns of WPF ListView

Page 1 of 1

0 Replies - 4324 Views - Last Post: 05 March 2010 - 05:35 AM Rate Topic: -----

#1 nav234   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 04-December 09

Bind data to multiple columns of WPF ListView

Posted 05 March 2010 - 05:35 AM

Hi all

Im using VB.net and WPF .

In a WPF page ,i have created a listview to show records added.

In XAML,i have

<ListView Margin="172,222,276,213" Name="ListViewDonotCall">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" Width="150" />
<GridViewColumn Header="Mobile Number" Width="150" />
</GridView>
</ListView.View>
</ListView>

But in vbcode i need to bind datas to its items

i have tried like
--------------------------------------------------------
i = ListViewDonotCall.Items.Count
ListViewDonotCall.Items.Add(TextBoxName.Text.ToString())
ListViewDonotCall.Items(i).SubItems.Add(TextBoxMobileNo.Text.ToString())
i = i + 1
---------------------------------------------------------
it gives error like sub item error

How can i bind data to multiple columns

Thanks in advance

Naveen

Is This A Good Question/Topic? 0
  • +

Page 1 of 1