1: using System;
2: using System.Collections.Generic;
3: using System.Text;
4: using Microsoft.SharePoint;
5: using Microsoft.SharePoint.WebControls;
6: using System.Web.UI;
7: using System.Xml;
8:
9: namespace CustLookuColumn
10: { 11: public class MultiLookUp : SPFieldLookup
12: { 13:
14: public MultiLookUp(SPFieldCollection fields, string fieldName)
15: : base(fields, fieldName)
16: { 17:
18: }
19:
20: public override void OnAdded(SPAddFieldOptions op)
21: { 22: base.OnAdded(op);
23: XmlDocument doc = new XmlDocument();
24: doc.LoadXml(this.SchemaXml);
25: XmlNode element = doc.FirstChild;
26: XmlAttribute attr = doc.CreateAttribute("Mult"); 27: attr.Value = "TRUE";
28: element.Attributes.Append(attr);
29: this.SchemaXml = doc.OuterXml;
30: base.Update();
31:
32: }
33: public MultiLookUp(SPFieldCollection fields, string typeName, string displayName)
34: : base(fields, typeName, displayName)
35: { 36:
37: }
38:
39: public override BaseFieldControl FieldRenderingControl
40: { 41: get
42: { 43: BaseFieldControl fieldControl = null;
44: fieldControl = new RenderFieldControl(); //See the below code snippet
45: fieldControl.FieldName = InternalName;
46: return fieldControl;
47: }
48: }
49: }
50: }