TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
lakshmitulasi jasti
NA
18
11.2k
How to create RadioButton(Choice) Column in List Client side
Feb 21 2013 4:29 AM
Hello Team,
I am trying to do SharePoint hosted APP's ,In that i want to create client side list, in that list i am having one choice column how to do that in client side ,the fallowing is the server side code.
if (!AnnouncementList.Fields.ContainsField("Publish To"))
{
//adding new column PublishTo
String Publishtofield = AnnouncementList.Fields.Add("Publish To", FieldType.Choice, false);
FieldChoice Pubtofield = (FieldChoice)AnnouncementList.Fields.GetFieldByInternalName(Publishtofield);
string[] Publishtypes = { "Groups", "Organization" };
Pubtofield.EditFormat = ChoiceFormatType.RadioButtons;
Pubtofield.Title = "Publish To";
Pubtofield.StaticName = "PublishTo";
Pubtofield.ShowInListSettings = true;
Pubtofield.ShowInDisplayForm = true;
Pubtofield.ShowInEditForm = true;
Pubtofield.ShowInViewForms = true;
Pubtofield.ShowInNewForm = true;
Pubtofield.DefaultValue = "Groups";
Pubtofield.Choices.AddRange(Publishtypes);
Pubtofield.Update();
AnnouncementList.Update();
}
if(!AnnouncementList.Fields.ContainsField("Publish"))
{
//adding new column Publish
string Pubfield = AnnouncementList.Fields.Add(<Field Type='Choice' DisplayName='Publish To'/>);
FieldUser user = new FieldUser(AnnouncementList.Fields, Pubfield);
user.SelectionMode = SPFieldUserSelectionMode.PeopleAndGroups;
user.AllowMultipleValues = true;
user.ShowInListSettings = true;
user.ShowInDisplayForm = true;
user.ShowInEditForm = true;
user.ShowInViewForms = true;
user.ShowInNewForm = true;
user.Update();
AnnouncementList.Update();
}
Normal Field i am added using this,
AnnouncementList.Fields.AddFieldAsXml("<Field Type='DateTime' DisplayName='Publish Date'/>", true, AddFieldOptions.DefaultValue);
Please give any examples or for that client code .
Thank's,
Lakshmi.
Reply
Answers (
0
)
How to enable Discussion board Likes
Error occurred in deployment step 'Install app for SharePoin