Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to get sharepoint custom list columns with ID

$
0
0

Hi ,

I have a custom sharepoint list named "Sample"

It has columns two columns "ProjectType" and "ProjectDesc".

Now , using WCF service I want to bind the column name and ID of the column ID and display them in a dropdownlist.

When I select a column in dropdown then it should display items in that column.

How to do this?

My Code to retive list

---------------------------

 List<string> lstProjects = new List<string>();
            string siteUrl = "http://home-pc:85/";

            ClientContext clientContext = new ClientContext(siteUrl);
            clientContext.Credentials = new System.Net.NetworkCredential("home", "123");
            Web site = clientContext.Web;

            //Getting List
            List list = site.Lists.GetByTitle("ProjectType");
            clientContext.Load(list);
            clientContext.ExecuteQuery();



            //Getting Column Names
            FieldCollection fieldCollection = list.Fields;
            clientContext.Load(fieldCollection);
            clientContext.ExecuteQuery();

            foreach (Field field in fieldCollection)
            {

            }



asa


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>