Binding data to Listview
-
Hi, I have a problem how to bind our database data into a listview..is it the same way we bind the data into gridview?could someone give me an example? Thank You
What problem? Explain clearly you problem? so that only we can help you.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
-
Hi, I have a problem how to bind our database data into a listview..is it the same way we bind the data into gridview?could someone give me an example? Thank You
Hi, In ListView you will have to Enumerate the datasource and fill it. For example, if your datasource is a DataTable, you can write the following: foreach(DataRow row in table.Rows) { ListViewItem item = new ListViewItem(); item.Text = row["Description"].ToString(); item.Tag = row["ID"].ToString(); //For other coulmns items.SubItems.Add(row["OtherColumn"].ToString(); } Hope this helps.
-
What problem? Explain clearly you problem? so that only we can help you.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
I'm sorry maybe my english is bad for example: I have a table name Contact in my database..and i want the data on that table to be show on a Listview..I already know how to bind it on a gridview, but i can't find a way to bind the data on a ListView..i use SQLServer 2005 Express Edition for the database Thank You:)