I am not sure if this behaviour is normal. I guess i have to investigate it another time. If you develop a listform using Visual Studio and based on an application page like i wrote in some other posts about it, you might notice, that in the edit and new form the save and cancel button does not work. They just do not firing the event.
The solution to this is really easy. In the schema file or by using code you change the listform url and also make the setting “UseLegacyForm” to true.
[sourcecode language=”csharp”]
[/sourcecode]
Doing so makes the save and cancel button working again, but now you have another stupid behaviour. Look at the screen: It is a generic / custom list as template, but it also shows buttons for edit series, claim release, distribution approval. What the hell is going on here?
I googled, tested but nothing worked for me. I thought that the connection is lost between ribbon and listform, but it seems not to be.
The only thing which helped me, was trimming the ribbon buttons one by one. Using the code below in the onPreRender method of my listform page.
[sourcecode language=”csharp”]
protected override void OnPreRender(EventArgs e)
{
SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
ribbon.TrimById(“Ribbon.ListForm.Edit.Actions.EditSeries”, “false”);
ribbon.TrimById(“Ribbon.ListForm.Edit.Actions.ClaimReleaseTask”, “false”);
ribbon.TrimById(“Ribbon.ListForm.Edit.Actions.DistributionListsApproval”, “false”);
if(this.FormToolBar.ControlMode == SPControlMode.New)
ribbon.TrimById(“Ribbon.ListForm.Edit.Actions.DeleteItem”, “false”);
base.OnPreRender(e);
}
[/sourcecode]
After deploying it with the code lines above it looks like this:
That’s what i can’t explain at the moment, but if you got an idea, let me know.
Well my other post are here:
Part 1: Setting up a solution with a list definition, a list instance and deploy it.
Part 2: Creating a custom list form and connect it with the list definition.
Part 3: Necessary settings for custom listform in Visual Studio
Part 4: Override Save Button in listform
..:: I LIKE SHAREPOINT ::..
Leave a Reply
You must be logged in to post a comment.