How to get the field of list item of sharepoint in ListView
Hi All…. This the code which get the fields of listitems in columns of ListView….. Check it out… It will also add ID of all items in Listivew’s first column……
For Each splist In spsite.OpenWeb.Lists
If (splist.Title = TvSites.SelectedNode.Text) Then
For Each SPField In splist.Fields
LvListItems.Columns.Add(SPField.Title.ToString)
‘i = i + 1 Next If (splist.Items.Count > 0) Then For Each splistitem In splist.ItemsLvListItems.Items.Add(splistitem.Item(0).ToString)
Next ElseMessageBox.Show(
"No Items in Selected List", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End If Next- Posted in: SharePoint
Recent Comments