Home > Sharepoint, SharePoint Custom Field Type, Sharepoint Field Types, Sharepoint List Field Types > Step by Step Tutorial for How to create and implement custom field type in SharePoint

Step by Step Tutorial for How to create and implement custom field type in SharePoint

November 5, 2009

Welcome Reader,

I have moved to a new blog site, so you can get same content from below new site URL!!

http://dishasharepointworld.blogspot.com/2009/11/hi-everyone-what-is-custom-field-type_04.html

Please feel free to post your comments/feedback into new blog, I’ll be more than happy to assistant you.

Sorry for any inconvenience!!

Disha Shah

Advertisements
  1. November 5, 2009 at 7:18 am

    Hi Disha,

    It is very nice article but unknowingly you missed few points and because of some missed part i was unable to create this. Can you please try and follow your steps as unknown person who has no idea in custom field types so you would be know missed part. I am sure that it would be very useful in future to write other article also.

    I would be appriciated your changes for this article.

    Regards,
    Viraj Vashi

  2. November 5, 2009 at 2:08 pm

    Hi Disha,

    I followed your link(http://msdn.microsoft.com/en-us/library/bb684919.aspx) which is really great but with help of this link i could not achieve my requirement.Project name is binding properly but selectedindexchanged event is not firing when i change the Project Name.

    FYI…
    Step 1: To create an empty SharePoint application project in Visual Studio 2005.
    Step 1.1: Start Visual Studio.On the File menu, click New, and then click Project.

    Step 1.2: In the Project Types pane of the New Project dialog box, select Visual C#, and then select the SharePoint category.

    Step 1.3: In the Templates pane, click Empty. Specify a Name and Location for the project, and then click OK. Visual Studio creates a solution that contains an empty project.

    Step 2: Adding a Field Control to the Project
    Visual Studio Extensions for Windows SharePoint Services 3.0 provides support for creating SharePoint field types through the Field Control project item.

    Step 3:To add a field control to the empty project
    Step 3.1: In the Visual Studio Solution Explorer, right-click the empty project created in the previous procedure, click Add, and then click New Item.

    Step 3.2:In the Categories pane of the Add New Item dialog box, expand the Visual C# Project Items node, and then select the SharePoint category.

    Step 3.3:In the Templates pane, click Field Control. Specify LogoField for the Name of the field control, and then click Add. Visual Studio adds the new field control to the project.

    In the Visual Studio Solution Explorer, open the LogoField.FieldControl.cs file.Which is below:

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Collections.Generic;
    using System.Text;

    namespace CFCLogoField
    {
    // TODO: Replace, as needed, “TextField” with some other class derived from Microsoft.SharePoint.WebControls.BaseFieldControl.
    [CLSCompliant(false)]
    [Guid(“6d8b3d2e-ffd8-40e5-91fd-13a5f134e5bf”)]
    public class LogoFieldFieldControl : BaseFieldControl, IDesignTimeHtmlProvider
    {
    protected DropDownList listBox;
    protected DropDownList _country;
    private HtmlTable table;

    protected void Country_SelectedIndexChanged(object sender, EventArgs e)
    {
    BindCountry();
    }

    protected override void CreateChildControls()
    {
    base.CreateChildControls();
    this.table = new HtmlTable();

    HtmlTableRow row = new HtmlTableRow();
    table.Rows.Add(row);

    HtmlTableCell cell = null;

    if (this.ControlMode == SPControlMode.Edit || this.ControlMode == SPControlMode.New)
    {
    cell = new HtmlTableCell();
    cell.ColSpan = 2;
    cell.Attributes[“class”] = “ms-formdescription”;
    cell.InnerText = “Custom field Demo:”;

    row.Cells.Add(cell);

    row = new HtmlTableRow();
    cell = new HtmlTableCell();

    this._country = new DropDownList();
    _country.SelectedIndexChanged += new EventHandler(Country_SelectedIndexChanged);
    _country.AutoPostBack = true;

    this.listBox = new DropDownList();

    // and add them to the listbox.
    SPSite site = SPContext.GetContext(this.Context).Site;

    SPDataSource dataSource = new SPDataSource();
    dataSource.List = site.RootWeb.Lists[“Project List”];

    this.listBox.DataSource = dataSource;
    this.listBox.DataTextField = “Project Name”;// lookup field of other custom list
    this.listBox.DataValueField = “Project Name”;

    this.listBox.DataBind();

    // Get the current value of the field.
    string currentValue = (string)this.ItemFieldValue;

    if (currentValue != null && currentValue != string.Empty)
    {
    this.listBox.SelectedValue = currentValue;
    }
    else if (this.listBox.Items.Count > 0)
    {
    this.listBox.SelectedIndex = 0;
    }

    cell.Controls.Add(this.listBox);
    row.Cells.Add(cell);
    table.Rows.Add(row);

    cell = new HtmlTableCell();

    LiteralControl literalControl = new LiteralControl();
    literalControl.Text = “Demo version Literal control”;
    cell.Controls.Add(literalControl);

    row.Cells.Add(cell);
    base.Controls.Add(table);
    }
    }
    }
    }

    Regards,
    Viraj Vashi

    • dishashah08
      November 5, 2009 at 2:38 pm

      Viraj

      I just did quick review of your code and noticed below things.

      1> you are binding List Box in which you Load data from SharePoint List and I think you need to add Selected Index changed event handler to
      Project List Dropdown List Box rather than Country Dropdown List Box

      2> you did not add any items to your Country Dropdown List , so it’s impossible to fire “selectedindex” changed event into country dropdown list without any data?

      Please verify these things.

      Thanks,
      Disha

  3. November 6, 2009 at 5:13 am

    Disha,

    Thank you very much for your reply.

    You are really brilliant and masters in sharepoint. Now,I came to know my mistake. Thank you very much. Appreciated.

    Now i will achive my requirement.

    Regards,
    Viraj Vashi

  4. November 19, 2009 at 2:39 pm

    HI Disha,

    I want to hide action menu’s item through javascript. I found one link which is this.
    http://sharepointquery.blogspot.com/2009/05/how-to-hideremove-alert-me-action-menu.html
    I tried it but it is not hiding.

    I have dout in this line of link:
    var allMenuItems = document.getElementsByTagName(‘ie:menuitem’);

    Can you check and if possible then correct it?

    Regards,
    Viraj Vashi

    • dishashah08
      November 19, 2009 at 10:20 pm

      Viraj

      Very nice requirement.

      If you want to hide “Alert Me” option, can you go through this link and try?

      1>It Refres easy and new way(Prefer this one)
      http://greggalipeau.wordpress.com/2008/01/21/removing-menu-items-from-sharepoint-list/

      2>
      http://stackoverflow.com/questions/1166148/hide-new-actions-upload-settings-menus-in-sharepoint-lists-document-libra
      This link also refers other link.

      Hope this Helps
      Disha Shah

    • dishashah08
      November 20, 2009 at 1:30 am

      Viraj,

      One more thing, can you please let me know what did you tried and what’s not working in your case?

      Actually you need to call hideListViewToolbarItems functions with respective parameters.

      NOTE from blog which you mentioned to me: “just call the function and pass the menu item names ( comma separated ) as they appear in the toolbar ignoring the case”

      and it seems that there is some tag or control named “ie:menuitem” into all SharePoint page, that’s why they are referring to “ie:menuitem” value.

      Thanks,
      Disha

  5. November 20, 2009 at 5:32 am

    Hi Disha,

    I am explaining you in details. I already found your both link and tried to implement using both link but i could achieve my requirement. I don’t know but i might have missed something in that.

    I tried following code.
    Point 1:
    foreach (Control control in this.Parent.Controls)
    {
    if (control.ToString()== “Microsoft.SharePoint.WebControls.NewMenu”)
    {
    control.Visible = false;
    } // etc
    }
    Which is there in one of your link. With use of above code i can hide “NewMenu” and “settingsmenu” but i could not hide “Actionsmenu” so that is why i decided to move on javascript and i found javascript which is also there in one of your link.

    Actually i want to hide action menu for particular group only and that group have design rights also(As per client’s requirement) so for that i took one webpart and in that i wrote below code and i added this webpart in custom list in which i want to hide action menu.(Using click on Site Action-> Click on Edit Page-> Add webpart in which i have written below code) so whenever i call custom list at the same time webpart also call and run below code. I hope you have understood perfectly.
    Point 2:
    protected override void CreateChildControls()
    {

    base.CreateChildControls();
    SPSite spCurrentSite = SPContext.Current.Site;
    spCurrentSite.AllowUnsafeUpdates = true;
    SPWeb site = SPContext.Current.Site.OpenWeb();
    site.AllowUnsafeUpdates = true;

    if (site.IsCurrentUserMemberOfGroup(site.Groups[“Client_1_Group”].ID) || site.IsCurrentUserMemberOfGroup(site.Groups[“Client_2_Group”].ID))
    {
    //testing script
    System.Web.HttpContext.Current.Response.Write(“alert(‘Please enter correct values.’);”);
    //script for hide action menu
    System.Web.HttpContext.Current.Response.Write(“function hideListViewToolbarItems(){var menuItem;var menuItemName; var menuItemIndex=-1; var menuItemNames=new Array(‘edit in datasheet’,’open with windows explorer’,’connect to outlook’,’export to spreadsheet’,’view rss feed’,’alert me’,’create column’,’settings:create view’,’list settings’,’document library settings’,’explorer view’,’all documents’,’all items’,’modify this view’,’view:create view’,’new document’,’new item’,’new folder’,’upload document’,’upload multiple documents’);var menuItems = new Array(‘EditInGridButton’,’OpenInExplorer’,’OfflineButton’,’ExportToSpreadsheet’,’ViewRSS’,’SubscribeButton’,’AddColumn’,’AddView’,’ListSettings’,’ListSettings’,’View1′,’DefaultView’,’DefaultView’,’ModifyView’,’CreateView’,’New0′,’New0′,’NewFolder’,’Upload’,’MultipleUpload’);var allMenuItems = document.getElementsByTagName(‘ie:menuitem’); Alert(document.getElementsByTagName(‘ie:menuitem’)); for(var i = 0; i < hideListViewToolbarItems.arguments.length; i++ ) {menuItemName= hideListViewToolbarItems.arguments[i].toLowerCase(); for (j=0; j < menuItemNames.length; j++){if(menuItemNames[j]==menuItemName){menuItemIndex = j;break;}}menuItem=menuItems[menuItemIndex];for (var l = 0; l < allMenuItems.length; l++){if(menuItemName.indexOf(':')!=-1){menuItemName = menuItemName.split(':')[1];}if (allMenuItems[l].id.indexOf(menuItem)!=-1 && allMenuItems[l].text.toLowerCase() == menuItemName){ var parentNodeOfMenuItem = allMenuItems[l].parentNode; parentNodeOfMenuItem.removeChild(allMenuItems[l]);break;}}}}hideListViewToolbarItems('Edit in Datasheet', 'export to Spreadsheet',
    'view rss feed');”);

    }

    }

    I can achieve using either using point 1 or Point 2 so please suggest me how can i hide action menu and its items.

    I would be very thankful to you.

    Regards,
    Viraj Vashi

  6. November 30, 2009 at 1:52 pm

    Hi All,

    I want to allow duplicate attachments in attachment of custom list. Currently in SharePoint, if we add one list item and attach same file for two times then it gives error.
    It gives following error:
    “The specified name is already in use.

    A document cannot have the same name as another document or folder in this document library or folder. Click your browser’s Back button, and type a new name.”

    As per our requirement I want to allow duplicate name.

    One more requirement is that if attachment file name is viraj.jpg and when we attach that time attachment name should rename with viraj_today’s datetime.jpg.

    Regards,
    Viraj Vashi

    • dishashah08
      December 3, 2009 at 3:10 pm

      Viraj,

      One thing is clear that we cannot attach same filename twice in SharePoint SPlistitem Attachments. If that’s your requirement then don’t you feel that user is also going to be confused to see two file name with same name and which file to open? I think it is not possible and that is good in prospect of user’s view too.

      Regarding your 2nd question, when you are attaching file you can update name of filename, write a custom event handler for itemattachmentadded event and take that file name and update SPfile.Name Property.

      Thanks,
      Disha Shah

  7. Amit Kumar
    December 2, 2009 at 10:39 pm

    I did the same thing but its showing me that method fieldrendering control not found.I m not sure what to do . Can you guide me if you want I can send you my code also.Please reply its urgent!!!!

    Thanks,
    Amit

    • dishashah08
      December 3, 2009 at 1:58 pm

      Hi Amit

      First let us get the detail description of error “fieldrendering control not found” , Go through this post and make changes to web.config and see what’s detail error description .

      https://dishashah.wordpress.com/2009/08/08/how-to-display-detailed-error-messages-into-sharepoint-page/

      Also Send me code your requirement and code.

      Thanks
      Disha Shah

      • Amit
        December 6, 2009 at 10:54 pm

        Hi Disha,

        Thanks a lot for replying. Could you please tell me where I can send you my code and actually I figured that out and I am able to create my column .Its working fine with list or libraries but now the problem is when I am creating page layout and wants to render it over there its showing: “Error Creating control “cannot instaniate control ” ABC” because it is not public”.

        Could you also tell me what you are trying to do in step 8) I didn’t get it properly.

      • dishashah08
        December 8, 2009 at 3:19 pm

        Hi Amit

        Answer of your Question which parent type, I can say you can take SPFieldMultiColumn.

        I need to look at the error “Error Creating control “cannot instantiate control ” ABC” because it is not public”, but at first I can give some clue like maybe you have some constructers or some functions has “private” or “protected” identifier.

        Step 8 is used for displaying and designing Control itself.

        You can post your code in comments section itself.

        Hope this helps
        Disha Shah

  8. December 4, 2009 at 12:45 pm

    Hi Disha,
    Appreciated.
    I have implemented and working fine.Thank you very much.

    One more thing, i want to know from you.
    I created one custom field which has two dropdownlist and based on first dropdown list, it displays second field data.(Eg. Project and based on its owners) and then if i have changed second dropdownlist(Owner’s values)’s value then it saves default value of second dropdownlist only means first value.

    protected DropDownList listBox;
    protected DropDownList _country;
    private HtmlTable table;
    private HtmlTable table1;

    protected void Listbox_SelectedIndexChanged(object sender, EventArgs e)
    {
    EnsureChildControls();

    this.table1 = new HtmlTable();

    HtmlTableRow row1 = new HtmlTableRow();
    table1.Rows.Add(row1);
    HtmlTableCell cell1 = null;

    // and add them to the listbox.
    SPSite site = SPContext.GetContext(this.Context).Site;
    SPQuery SPQowner = new SPQuery();
    SPQowner.Query = “” + listBox.SelectedItem.Text.Trim() + “”;

    this._country.DataSource = site.RootWeb.Lists[“Project List”].GetItems(SPQowner).GetDataTable();
    this._country.DataTextField = “Owner”;
    this._country.DataValueField = “Owner”;
    this._country.DataBind();

    cell1 = new HtmlTableCell();
    cell1.Controls.Add(_country);

    row1.Cells.Add(cell1);
    base.Controls.Add(table1);

    }
    protected override void CreateChildControls()
    {
    base.CreateChildControls();
    SPSite site = SPContext.GetContext(this.Context).Site;
    this.table = new HtmlTable();

    HtmlTableRow row = new HtmlTableRow();
    table.Rows.Add(row);

    HtmlTableCell cell = null;

    if (this.ControlMode == SPControlMode.New || this.ControlMode == SPControlMode.Edit)
    {
    cell = new HtmlTableCell();
    cell.ColSpan = 2;
    cell.Attributes[“class”] = “ms-formdescription”;

    string currentValue = (string)this.ItemFieldValue;

    row.Cells.Add(cell);

    row = new HtmlTableRow();
    cell = new HtmlTableCell();

    this._country = new DropDownList(); //Create object of dropdown list
    this.listBox = new DropDownList(); //Create object of dropdown list

    listBox.SelectedIndexChanged += new EventHandler(Listbox_SelectedIndexChanged);
    listBox.AutoPostBack = true;

    // and add them to the listbox.
    SPDataSource dataSource = new SPDataSource();
    dataSource.List = site.RootWeb.Lists[“Project List”];

    this.listBox.DataSource = dataSource;
    this.listBox.DataTextField = “Project Name”;
    this.listBox.DataValueField = “Project Name”;

    this.listBox.DataBind();

    // Get the current value of the field.
    if (currentValue != null && currentValue != string.Empty)
    {
    this.listBox.SelectedValue = currentValue;
    }
    else if (this.listBox.Items.Count > 0)
    {
    this.listBox.SelectedIndex = 0;
    }

    cell.Controls.Add(this.listBox);
    row.Cells.Add(cell);
    table.Rows.Add(row);

    base.Controls.Add(table);

    }
    }
    public override void UpdateFieldValueInItem()
    {

    base.UpdateFieldValueInItem();

    this.Value = this.listBox.SelectedItem.Text + “#” + this.listbox1.selectedItem.text;
    this.ItemFieldValue = this.listBox.SelectedItem.Value;
    }

    }

    I found from google that there is one SPFieldMultipleColumn and we can save both control’s value in one customfield but i dont know how to use this. My requirement is that it should retrieve last Projectname and its respective owner’s value for particular listitem.

    I hope you have understood my problem.

    Regards,
    Viraj Vashi

    • dishashah08
      December 4, 2009 at 1:30 pm

      Viraj

      I think the mistake should be in this function
      public override void UpdateFieldValueInItem()
      {

      base.UpdateFieldValueInItem();

      this.Value = this.listBox.SelectedItem.Text + “#” + this.listbox1.selectedItem.text;
      this.ItemFieldValue = this.listBox.SelectedItem.Value;

      }

      }

      this.ItemFieldValue = this.listBox.SelectedItem.Value; Line should be like
      this.ItemFieldValue = this.listBox.SelectedItem.Value + “#” + this.listbox1.selectedItem.Value;

      If you look at the example of mine, you can see I did with SPFieldMultipleColumn class only and I did not write method UpdateFieldValueInItem(), but I have created a new class for getting and set its value Which is in Step#8.

      Hope this helps you or assist to solve your problem

      Thanks
      Disha Shah

  9. December 7, 2009 at 7:33 am

    Hi Disha,

    I have tried with your suggestion but still my problem not solved. If possible then kindly
    post one blog with use of Visual studio extension (like you have given before one very important link which is http://msdn.microsoft.com/en-us/library/bb684919.aspx).
    I know that you are the master in sharepoint so for you it is just half an hour task but it will save my couple of days.

    If possible then bind state value from other custom list like i did and based on that state bind city using CAML query. I am unable to find where did i mistake.

    I would be really very thankful to you.

    Regards,
    Viraj Vashi

    • dishashah08
      December 8, 2009 at 2:24 pm

      Hi Viraj

      I checked your code and find a problem this first
      SPQowner.Query = “” + listBox.SelectedItem.Text.Trim() + “”;

      You SPquery has problems,because you did not mention “”, I already provide that example
      It should look like this

      SPQuery strquery = new SPQuery();
      NOTE: Problem if Post code which has tags

      Query = “OrderBy” +
      “FieldRef Name=’FileLeafRef’ ” +
      “OrderBy” +
      “Where” +
      “Eq” +
      “FieldRef Name=’DocIcon’ ” +
      “Value Type=’Text'” +
      “xml” +
      “Value” +
      “Eq” +
      “Where”;

      My question is you are unable to show values or save values in Fieldcolumn.

      Are you able to get items from city and display? Or Are you not able to save their values?

      I did same thing for my project that User can select DropDown A , and depends on that value it displays values from list and fills out the other DropDown List B and same from Dropdown value B it takes and fills value for DropDown C.

      If you have followed my example , I did not write method that you have written for Update Value Item in the function named as UpdateFieldValueInItem(), I have written entire one three classes
      1> Creating a Custom Field Type
      2>Creating a Custom Field Value ( I specify values for all dropdown there)
      3> Creating a Custom Field Control
      Other one is for its XML file for definition
      1> Creating a Custom Field Type Definition

      Hope this helps
      Disha Shah

      • December 9, 2009 at 5:26 am

        HI Disha,
        All values are comming properly but problem is only with saving data. It saves state value but it is not saving city values(Means second dropdownlist’s value). If i do not change second dropdownlist value(Second dropdownlist’s value come based on first dropdownlist) then first and secord both dropdownlist’s values save but if i will change second dropdownlist’s value then it is saving first dropdownlist’s value and second dropdownlist’s first value means it is not saving changed value of second dropdownlist.

        Hope now you have clearly understood my problem.

        Regards,
        Viraj Vashi

  10. Amit
    December 7, 2009 at 4:20 pm

    Hi Disha,

    One more thing I want to ask to you. Could you tell me which parent type I need to use if I m using both dropdown and lookup field in my custom field type.Actually I want the same thing like you did but instead of text I want to use lookup field.Any suggestions how to acheive this??

    Any help would really be appreciated.

    Thanks,
    Amit

  11. Subodh
    December 8, 2009 at 11:35 am

    Hi Disha,

    I tried to configure EMail Server in Sharepoint Server 2007, but its not working.

    I have gone through so many blogs/websites but couldn’t find any solution.

    Do you have any simplest way to configure the same?

    Regards,
    Subodh

  12. Subodh
    December 8, 2009 at 2:55 pm

    Hi Disha,

    I have received your mail. I tried all the steps earlier which are mentioned by you but no luck.
    I want to send/receive alerts.

    If anyone make changes to DOCs which are present in DOCUMENT LIBRARY in Sharepoint server then I should email alert of the same.

    Tried a lot but no luck.

    Hope you could help me to sort out this issue.

    • dishashah08
      December 8, 2009 at 3:23 pm

      Subodh

      Did you check IIS Log or Sharepoint Logs? May be that helps to sort out the problem.

      Thanks
      Disha Shah

  13. Amit
    December 8, 2009 at 3:36 pm

    Hi Disha,

    I did with SPMultiColumn and its working fine.Thanks for your reply.

    The only problem now is for rendering it in page layout.Now the error is coming out to be different
    it is :

    Error Creating Control-AssetVideoControl
    Unkonwn server tag ‘Custom Tag_0:CountryRegionControl’

    When I drag and drop the column into page layout then I am getting the grey block where its showing this msg.
    Idk as at the top of the page it is creating

    here is my code..Would really appreciate if you can tell me where I m getting wrong.

    Idk how to paste all my code as it is bigger than your blog because of the extra functionality i have added.I have test it and its working fine in the list but only thing is when display it in page layout.

    namespace VideoDropDown
    {
    public class AssetVideoControl : BaseFieldControl, IDesignTimeHtmlProvider
    {

    private const string RENDERING_TEMPLATE = “AssetVideoControl”;
    private const string Video = “Videos”;
    private const string Interview = “Interviews”;

    protected DropDownList _AssetType;
    protected ListBox _Video;
    // protected DropDownList _Article;
    protected Literal _videoSelectorLiteral;
    protected Literal _articleSelectorLiteral;

    // SPList org;
    string IDesignTimeHtmlProvider.GetDesignTimeHtml()
    {

    return “AssetType,Video,Interview…”;
    }

    //string IDesignTimeHtmlProvider.GetDesignTimeHtml()
    //{
    // StringBuilder designTimePreview = new StringBuilder();
    // designTimePreview.Append(“”);
    // designTimePreview.Append(“”);
    // designTimePreview.Append(“{0}”);
    // designTimePreview.Append(“”);
    // designTimePreview.Append(“”);
    // designTimePreview.Append(“{1}”);
    // designTimePreview.Append(“”);
    // designTimePreview.Append(“”);
    return string.Format(designTimePreview.ToString(), this.Field.Title, “Video, ” + Video);
    //
    // }

    I was thinking of using above design pattern as described by Andrew Connell but its not working(one of the obove two) but none of them is working.

    Thanks,
    Amit

    • Amit
      December 8, 2009 at 3:39 pm

      I mean at the top of the page when I drag and drop it is creating %Register (Assembly details) %

      • dishashah08
        December 8, 2009 at 3:59 pm

        Amit

        Can you send me your field type definition xml?

        Disha Shah

  14. Amit Kumar
    December 8, 2009 at 6:15 pm

    Hi Disha,

    Here it is :



    CustomDropDownField
    MultiColumn
    Featured Video
    Filtered AssetType dropdown
    TRUE
    TRUE
    TRUE
    TRUE
    TRUE
    VideoDropDown.CustomDropDownField,VideoDropDown,Version=1.0.0.0,Culture=neutral, PublickeyToken=e1a7e11950e50f13



  15. Amit Kumar
    December 8, 2009 at 6:17 pm

    sorry it didn’t come rite.Here it is

    CustomDropDownField
    MultiColumn
    Featured Video
    Filtered AssetType dropdown
    TRUE
    TRUE
    TRUE
    TRUE
    TRUE

    VideoDropDown.CustomDropDownField,VideoDropDown,Version=1.0.0.0,Culture=neutral, PublickeyToken=e1a7e11950e50f13

  16. Amit Kumar
    December 8, 2009 at 6:20 pm

    I don’t know Disha its not coming over here.Could you tell me some other place I can send you :

    mainly it includes
    TypeName”>CustomDropDownField
    ParentType”>MultiColumn
    TypeDisplayName”>Featured Video
    TypeShortDescription”>Filtered AssetType
    UserCreatable”>TRUE
    ShowInListCreate”>TRUE
    ShowInSurveyCreate”>TRUE
    ShowInDocumentLibraryCreate”>TRUE
    ShowInColumnTemplateCreate”>TRUE
    VideoDropDown.CustomDropDownField,VideoDropDown,Version=1.0.0.0,Culture=neutral, PublickeyToken=e1a7e11950e50f13
    <RenderPattern Name="DisplayPattern"

    • Amit Kumar
      December 8, 2009 at 6:45 pm

      on page layout at the top this register directive is there:
      %@ Register tagprefix=”CustomTag_0″ namespace=”VideoDropDown” assembly=”VideoDropDown, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e1a7e11950e50f13″ %

      This is when I drag and drop field
      CustomTag_0:AssetVideoControl FieldName=”AssetVideo” runat=”server” id=”AssetVideoControl1″>
      </CustomTag_0:AssetVideoControl

      Thanks,
      Amit
      amitbhuttan@gmail.com

      • Amit Kumar
        December 11, 2009 at 10:55 pm

        Hi Disha,

        Any idea about my problem?

        Thanks,
        Amit

      • dishashah08
        December 30, 2009 at 6:50 pm

        Hi Amit

        Nope no idea about the problem, did you find any solution?
        Please share if you found any solution.

        Thanks
        Disha Shah

  17. Navaratan
    December 28, 2009 at 6:37 am

    Hello Disha
    It is very nice article, can i get custom coulmn event on my List.

    • dishashah08
      December 30, 2009 at 6:36 pm

      Hi Navaratan

      I did not understand your question. Sorry about that. Because there is nothing Custom Column event in SharePoint.

      You were asking about some event handler or Custom Field type? Can you let me know your requirement or give some more description what you want to achieve so I can reply.

      Thanks
      Disha Shah

  18. Prem
    January 5, 2010 at 6:46 am

    Hi Disha

    I need to rename the menu item and its description for a list toolbar ,I am using the text and description property to set the value. it works fine in IE but it doesn’t work in mozilla,it seems to be the text and description properties is not supported in mozilla.

    So can u plz tell me what i will do to work this one in mozilla.

    Thanks
    Prem

  19. Sai
    February 5, 2010 at 7:31 am

    Hi Disha

    First of all thanks for your valuable blogs.

    I have small question.

    I Created one custom filed, which inhertis SPFieldMultiChoice. While i deployed this field in sharepoint, its working proeprly. As i have to stroe multiple values, i am storing the values with “;” separated. But my cutom field(column) is not working for flter purpose(In column header). So can you plese tell me, how can i enable filter part in column heading.

    Thanks
    Sai

  20. Sai
    February 5, 2010 at 8:53 am

    Hi Disha

    I have one custom list, whcih contains one user column. Which accepts multiple user names.

    Now my requirement is like this

    1. click add new item
    2. In add screen – entered multiple usernames(e.g. 5 usernames) in user field. Also entered rest of the fields.
    3. In the click of save button, it should create 5 different list items for 5 different users.

    How will i achive this.

    Thnaks in advance

    Regards
    Sai

    • dishashah08
      February 10, 2010 at 1:17 am

      Hi Sai

      Thanks for appreciation. You can create a webpart and when you click on “Save” button you need to add one logic part which counts how many users are there with string.split function and store in String Array. You need to put one count variable which length is equal to String Array and then create every new item for that list.

      Hope this helps
      Disha Shah

      • Sai
        February 12, 2010 at 1:39 pm

        Hi Disha

        Thanks for your comments.

        But i can’t go for webpart. It has some client restriction is there.

        I need to implement this through item events only(I think so). So please give some idea, how can i do this through item events.

        Thanks
        Sai

      • dishashah08
        February 12, 2010 at 2:05 pm

        Hi Sai

        You can try this way.

        Develop ItemAdding List Event Handler and write logic for split multiple items and add new items in Lists in a new function.

        Let us say user enters five items in that field and now you have to create five list items.

        Create one function name as for example “AddOtherItems(String stringUserNames)”.

        Now call function AddOtherItems(stringUserNames) in “EventHandler -ItemAdding”, Iterate through every user name and add item .Before add item write this “this.DisableEventFiring();”

        NOTE : You must add “this.DisableEventFiring();” otherwise it will go in infinite loop. Once you are done with the function call this.EnableEventFiring(); So next time when you add a new item from interface so we can add multiple items

        Hope this helps!!!!
        Disha Shah

      • Sai
        February 15, 2010 at 6:25 am

        Hi Disha

        Can you please tell me, how can i get the currently filled item values in “item adding” event.

        Thnaks Sai

      • dishashah08
        February 16, 2010 at 1:59 pm

        Hi Sai

        Here is example how you can get the currently field item values in “itemadding” event

        foreach (DictionaryEntry entry in properties.AfterProperties)
        {
        if (entry.Key.Equals(“Fieldname”))
        {
        strProgramName = entry.Value.ToString();
        break;
        }
        }

        Thanks
        Disha Shah

  21. Rajesh
    March 10, 2010 at 5:40 am

    Hi Disha,
    your posts are really very good and helpful.
    I have one question for you…
    I have designed Custom Master Page for our sites, But the Custom Master page is not inheriting to _layouts pages and to the sites created with custom templates.
    I know that _layouts pages use Application.Master… Is there any way I can deploy my custom Master page to all the site contents, Pages, Admin Pages and to all newly created sites(newly created sites should automaitally use my Custom master page)
    please let me know.

    Cheers

    Raj

    • dishashah08
      March 12, 2010 at 2:30 am

      Rajesh

      Thanks for appreciation about my posts.

      No, there is no way to apply custom master page for all Application Pages because they inherit application.master.

      If you want to change layout of the Application Pages , you must need to apply that changes in application.master. It is not recommended to change application.master file.

      Thanks & Regards
      Disha Shah

  22. PS123
    March 13, 2010 at 8:16 pm

    Didn’t see any reference of Andrew Connell in your blog…?

  23. Alkesh
    March 16, 2010 at 9:54 pm

    Nice post Disha. Keep it up 🙂

  24. Paula
    May 7, 2010 at 10:20 am

    Hello Disha,

    Do you know if it is possible to make a sharepoint custom field whith a popup window? I was trying to do that whith a link custom field. Can you give me a hand with this?

    Thks

    • dishashah08
      May 8, 2010 at 5:45 pm

      Paula

      You can do it by create a link button and open the window by using javascript.

      Hope this helps
      Disha Shah

  25. Paula
    May 8, 2010 at 7:35 pm

    Disha,

    Link button in a site column is it? because my problem is that i need to make a custom field (available in a site column) that, when i edit the item that part is available as a popup window.

    thanks for all your help.
    Paula

  26. Arun
    September 3, 2010 at 11:24 am

    Hi Disha,
    your posts are really very good and helpful.
    I have one question for you…
    i have a requirement with custom datetime field with 1 min incremental and got the same in codeplex(http://datetimebyminute.codeplex.com/).
    But im facing an error when i use this in “Edit in SpreadSheet” mode, the custom field is in READ ONLY format(i cant able to give any value) and the required field validation is missing in this mode(SpreadSheet Mode).Rest of the all features are working fine.
    could you please help me to solve this issue if you can.
    Please mail me(knarunkumar@gmail.com) if you have any code for this.

    Thanks
    Arun

  27. Arun
    September 3, 2010 at 11:55 am

    Disha

    Sorry, Not in Spreadsheet mode it happens in “Edit in DataSheet” Mode

    Thanks
    Arun

    • dishashah08
      September 13, 2010 at 1:18 am

      Arun

      I have gone through your requriement and aslo downloaded and checked the .wsp file.
      Can you please make the change in this file fldtypes_DateTimeByMinute.xml and add the line False.

      If this is not solved please let me know and post new comment on my new URL.

      FYI: I have moved to a new URL that is http://dishasharepointworld.blogspot.com and I have moved all contents to new URL.

      You are referring the same blog on this URL is
      http://dishasharepointworld.blogspot.com/2009/11/hi-everyone-what-is-custom-field-type_04.html

      I REQUEST please post comments now on wards to their blog.

      Thanks and See you on new blog URL
      Disha Shah

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: