14 April 2012 6:39
I made a custom list on task.
I want to add a column to the list with VS.
How to do that?
- Jenis yang Diubah Ronaldo.K 14 April 2012 7:03
14 April 2012 7:30
If list is created using custom listdefintion template "Tasks" then you can directly add Field tag in schema.Which will create field to the list.
If you have created list from UI, then you can write code to create field to it.
Options to create field would by creating console application, powershell script or binding code in feature receiver.
Check code to create field in below articles
14 April 2012 8:07Moderator
Use the SPFieldCollection.Add Methodusing (SPSite site = new SPSite("your_site_url"))
using (SPWeb web = site.OpenWeb())
SPList list = web.Lists["your_custom_list"];
catch (Exception ex)
string message = ex.Message;
If the field is requierd to contain a value ,change the last param to true
14 April 2012 8:58I want to know how to modify schema.xml file.
14 April 2012 10:41Moderator
In short, you have to edit the <Fields> and <ViewFields> elements .
The following links should be useful:
- Ditandai sebagai Jawaban oleh Ronaldo.K 14 April 2012 22:10