I have a web part and I dynamically add a List field iterator to it:
//contentType is the content type ID
SPList list = web.Lists[listName];
SPContentType spct = web.AvailableContentTypes[contentTypeName];
Iterator = new ListFieldIterator()
{
ControlMode = SPControlMode.Display,
TemplateName = spct.NewFormTemplateName,
ListId = list.ID
};
Iterator.ListItem["ContentTypeId"] = contentType;
Iterator.EnableViewState = true;
var currentMode = SPControlMode.New;
Iterator.ControlMode = currentMode;
PlaceHolder p1 = (PlaceHolder)this.FindControl("PlaceHolder1");
p1.Controls.Add(Iterator);
I have 2 questions:
How I can hide the buttons that appear with the list field iterator?
I want to add a method that create the item (Library list item with attachment) by code, by reading the item of list field iterator and create it, how I can do it?
0 commentaires:
Enregistrer un commentaire