tags:

views:

36

answers:

1

There is a custome column name "Tag" in my Discussion List.

How can I add a textbox to init "Tag" column when I new one.

As we know, NewForm.aspx only show Subjet, Body textbox as default. But only show Body text when reply.

How can i custome NewForm.aspx to show Subject, Tag,Body textbox when I new one and only show Body textbox when reply.

Thanks

A: 

Via SharePoint API you can define where a field should be displayed:

SPField f = list.Fields.GetField("Tag");
f.ShowInShowInNewForm = true;
f.Update();

There are several properties to control where a field should be displyed. Check SPField class members for more information.

Jason
Thank you. Jason. It resolve my question.By the way. I have another solution to fix it.Would you please help me to check my solution have any issuce?My solution is:New a Column name "Tag" in Schema.xml, Deploy project, go to List Setting ->Click link of Discussion on Content Types ->Click link of Add from existing site or list columns on Columns -> Add "Tag" from List Column.After that, I can show Tag column when new item and hide Tag when reply item.Thank