I have a sharepoint list "tracker" with fields dropdownlist "Area" and textbox name.
I have 3 values in Area dropdown. I want to retrieve all 3 items from Area drop down and bind to combobox in Winforms.
But This retrieves only one selected item from area but i want all items of that dropdown.
I have 3 values in Area dropdown. I want to retrieve all 3 items from Area drop down and bind to combobox in Winforms.
SP.ClientContext clientcontext = new SP.ClientContext("mysite/sitecoll");
SP.List list = clientcontext.Web.Lists.GetByTitle("tracker");
clientcontext.Load(list);
SP.CamlQuery _query = new SP.CamlQuery();
_query.ViewXml = @" <View> <Query> <Where> <IsNotNull> <FieldRef Name = 'Area_x0020'/>
</IsNotNull> </Where> </Query> <RowLimit>10</RowLimit> </View>";
SP.ListItemCollection _listitems = list.GetItems(_query);
clientcontext.Load(_listitems); clientcontext.ExecuteQuery();
foreach (SP.ListItem listItem in _listitems.ToList())
{
cbAppArea.Items.Add(listItem["Area_x0020"] != null ? listItem["Area_x0020"].ToString() : string.Empty);
}
But This retrieves only one selected item from area but i want all items of that dropdown.