Presentation is loading. Please wait.

Presentation is loading. Please wait.

Minneapolis Office Developer Interest Group (MODIG) March 25, 2008 Custom Column Development Neil Iversen Inetium

Similar presentations


Presentation on theme: "Minneapolis Office Developer Interest Group (MODIG) March 25, 2008 Custom Column Development Neil Iversen Inetium"— Presentation transcript:

1 Minneapolis Office Developer Interest Group (MODIG) March 25, 2008 Custom Column Development Neil Iversen Inetium http://justaddcode.com/

2 The Plan  Introduction  You are here  Feature Presentation  Custom Columns  Next Topic Selection  Random Stuff

3 User Group Goals  Provide a community for SharePoint Developers  Share development knowledge  Exchange tips/tricks/other/free pizza  Know that SPSimpleFormattingEncodedResourceExpressionBuilder is the longest Object Model Class Name

4 User Group Format  Presentations  1-2 per meeting  Hopefully Demo Heavy (Slides are for MBAs)  Highlights of Nifty Things  See next slide  QA/Discussion/Random Things

5 Call for Cool Stuff  Created something cool?  Send Screenshots or Videos  We’ll try to feature some items here

6 Sharepointmn.com/modig/  Our current home  Meeting information  Usually has the right time  Previous presentations  Running on SharePoint  As required by SharePoint User Group Law

7 Upcoming  Next Meeting  April 17 (5:30pm)  Topic: TBD – Hopefully later today  MNSPUG  April 9 (9:00am – Noon)  Topic : TBD (sharepointmn.com)sharepointmn.com

8 Custom Fields – A Code Heavy Approach  Custom Column Intro  Basic Column Development  Deploying Columns  Developing Fancier Columns  Questions

9 Custom Fields/Columns/Types  No Matter What you Call It  They’re fun!  Create for Special Purposes  Complex Data  Increased Validation  Prettier UI

10 Custom Fields/Columns/Types  Derived From SPField  SPFieldText  SPFieldNumber  SPFieldMultiChoice  …  UI Derived From BaseControlTemplate  XML Defined  12\TEMPLATE\XML  Core Fields are in FLDTYPES.XML

11 Custom Fields Schema Data Field - Just Add Code MultiChoice Data Field - Just Add Code A Practical Custom Field MODIG0803.Fields.DataField, MODIG0803.Fields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c0d2e6ac5478941 TRUE

12 Deploying A Field  DLLs  Installed into the GAC  FLDTYPE  12\TEMPLATE\XML\  iisreset  Cross Fingers  It never hurts

13 Demo – Our First Field

14 Advanced Custom Fields Schema Data Field - Just Add Code MultiChoice Data Field - Just Add Code A Practical Custom Field MODIG0803.Fields.DataField, MODIG0803.Fields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c0d2e6ac5478941 TRUE <Field Name="Another Field" DisplayName="Another Field I can See" ShowInNewForm="TRUE" ShowInEditForm="TRUE" Type=“Number" Hidden="FALSE">

15 Demo – More Advanced Schema

16 Advanced Custom Fields Schema Data Field - Just Add Code MultiChoice Data Field - Just Add Code A Practical Custom Field MODIG0803.Fields.DataField, MODIG0803.Fields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c0d2e6ac5478941 TRUE ]]> Surrounded!]]>

17 Render Patterns  HeaderPattern – Column Title  DisplayPattern – List Item View  EditPattern – Edit Form View  NewPattern – New Form View  PreviewDisplayPattern  PreviewEditPattern  PreviewNewPattern

18 Demo – More Advanced Schema

19 Control StateSequence  Field Is Loaded  GetFieldValue - Restored from ‘Serialized’ state  Field Rendering Control is Loaded .Value is SET  Control Mode Property  Tied to action against ListItem  SPControlMode  Display, Edit, New, Invalid  Value is retrived via GET  GetValidatedString

20 DEMO – What does that Look Like?

21 Custom Validation – Server Side  Override GetValidatedString(Object value)  Final Call in Field Setting Lifecycle  Called during most Save’s  Ex: SPListItem.Properties[“MyValue”]  Not Always Called  Web Services  RPC  DataSheets  Proper Validation Error: SPFieldValidationException  Can be used to ‘set’ the final value

22 DEMO – Odd Validation

23 Field Validation – UI Side  Override Validate()  Set the IsValid property  ErrorMessage to the text of the Error  SDK Example: if (Field.Required && (Value == null || Value.ToString().Length == 0)) { this.ErrorMessage = Field.Title + " must have a value." IsValid = false; return; }

24 DEMO – Odd Validation

25 Adding Useful Features  CONTROLTEMPLATES  ASCX File for a Field  Data Access Code Behind  Pull in and validate data against external Systems  Expand UI Functionality  AJAX.NET  Silverlight (http://www.ssblueprints.net/sharepoint/)http://www.ssblueprints.net/sharepoint/

26 DEMO - Lets get (or fake) some Data!

27 Summary  Fields are Fun  Difficult Learning Curve  State Management is Key  Validation is Two Fold  Field Level Validation  UI Level Validation  Neither always run  EventReciever for True Validation

28 Questions?

29 Next Meeting Planning  Possible Topics  PowerShell and SharePoint for Developers  Using the MS AJAX Framework in SharePoint  Managing Context in SharePoint  Introduction to Workflow  Silverlight 2 and SharePoint  …

30 Random Stuff Neil Iversen Inetium http://justaddcode.com Feedback Forms/Giveaway Mingle, Eat, Feedback See you next time!


Download ppt "Minneapolis Office Developer Interest Group (MODIG) March 25, 2008 Custom Column Development Neil Iversen Inetium"

Similar presentations


Ads by Google