开发者

Sharepoint 2010 List, calculated value

开发者 https://www.devze.com 2023-01-08 03:47 出处:网络
With a sharepoint list, is it possible to calculate a column value basing on other columns of the list value using a C# Method ?

With a sharepoint list, is it possible to calculate a column value basing on other columns of the list value using a C# Method ?

My list contains start and end dates and i want to show business d开发者_JAVA百科ays of these dates intervals by using an home made c# method. I would prefer to do that in real time when showing the list, but if it is not possible, is it possible to call my c# method while creating a new row ?

Thank's by advance ^^


You can put your code into an Event Receiver which fires on the item being added/updated.

Here is one example: Developing an Event Receiver for a Document Library


If you want the value to be updated every time the list is displayed, you should create your own custom field. This way you can calculate the intervals at the time of rendering and display the value you want. As the field can't be edited, you only need to provide your own variants of the GetFieldValue methods. You won't need to create a special rendering control or provide an XSLT stylesheet.

You will have to provide properties for the other fields names, so your field can be configured when it's added to a list.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号