Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

I want to change the column name of Title when we create the list at that time using client side object model ..is it possible..?

$
0
0

Hi to all ,

I want to change the column name of Title when we create the list at that time using client side object model ..is it possible..?

I created the list using this code..

                    ListCreationInformation createinfo = new ListCreationInformation();
                    createinfo.Title = "TestForThought123";
                    createinfo.Description = "Thought of the day list creted using CSOM";
                    createinfo.TemplateType = (int)ListTemplateType.GenericList;

                    List newList = clientContext.Web.Lists.Add(createinfo);

                    clientContext.Load(newList);
                    clientContext.ExecuteQuery();

                    string FieldAsXML = "<Field Name='AuthorName' DisplayName='AuthorName' Type='Text' Hidden='False'/>";
                    Field fld = newList.Fields.AddFieldAsXml(FieldAsXML, true, AddFieldOptions.DefaultValue);

                    newList.Update();
                    clientContext.ExecuteQuery();

I created list successfully but the Title column is by default in list. So i want to change the name of that Title column name.

How i will do..?


Viewing all articles
Browse latest Browse all 8089

Trending Articles



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