Creating Dropdown as custom webpart properties

Hi,
I have currently created a custom string (textbox) webpart property.
I would like to add another webpart property which is of dropdown model (enum). However, I am not able to create and associate a default value.
I want to create a enum as below:
public enum _ddlPager { 10, 20, 50,100 }
And also set the default value as 10.
I have already checked:
http://www.ashokraja.me/articles/How-to-create-a-custom-property-and-set-a-default-value-in-a-SharePoint-2013-Visual-WebPart
http://www.learningsharepoint.com/2013/08/22/create-custom-webpart-properties-for-sharepoint-2013-visual-webpart/
But I was not able to add the numbers.
How to create a dropdown for custom webpart property?
Thanks

Hi,
Thanks for the reply.
I have tried like this, but the code has errors:
#region Custom web part property
private propertyPager _ddlpropertyPager ;
public enum propertyPager
_1a = 10,
_2a = 20,
_3a = 50,
_4a = 100
[WebBrowsable(true), Personalizable(PersonalizationScope.Shared)]
public propertyPager propertyPageNumbers
get { return _ddlpropertyPager; }
set { _ddlpropertyPager = value; }
public override EditorPartCollection CreateEditorParts()
ArrayList editorArray = new ArrayList();
CustomProperty edPart = new CustomProperty();
edPart.ID = this.ID + "_editorPart1";
editorArray.Add(edPart);
EditorPartCollection editorParts = new EditorPartCollection(editorArray);
return editorParts;
public void SaveChanges()
this.SetPersonalizationDirty();
//Create a custom EditorPart to edit the WebPart control.
private class CustomProperty : EditorPart
DropDownList _ddlPager;
public CustomProperty()
Title = "Custom Properties";
public override bool ApplyChanges()
SummaryWP part = this.WebPartToEdit as SummaryWP;
part.propertyPageNumbers = ddlPage.SelectedValue.ToString();
part.SaveChanges();
return true;
public override void SyncChanges()
EnsureChildControls();
SummaryWP part = (SummaryWP)WebPartToEdit;
_ddlPager.SelectedValue = part.propertyPageNumbers;
protected override void CreateChildControls()
Controls.Clear();
_ddlPager = new DropDownList();
Controls.Add(_ddlPager);
protected override void RenderContents(HtmlTextWriter writer)
writer.Write("Items Per Page :");
writer.WriteBreak();
_ddlPager.RenderControl(writer);
writer.Write("");
writer.WriteBreak();
writer.Write("--------------------------");
private DropDownList ddlPage
get
EnsureChildControls();
return _ddlPager;
#endregion }}
Getting error in function "Apply Changes" and "Sync Changes"
How to fix this?
Thanks

Similar Messages

  • Creating Custom persisted properties?

    Hi All,
    As as read atg.adapter.gsa.GSAPropertyDescriptor class will be use to create custom persisted properties. Then what is difference b/w custom persisted property, that we creating using property-type = sub class of above class and simple property that is in any table?
    Hint: custom persisted property is declared in .xml file outside of table just like transient property.
    -RMishra

    Hint: custom persisted property is declared in .xml file outside of table just like transient property.You can not have a persistent property outside <table>. If you do that your repository definition xml validation will fail during startup.
    As as read atg.adapter.gsa.GSAPropertyDescriptor class will be use to create custom persisted properties. Then what is difference b/w custom persisted property, >that we creating using property-type = sub class of above class and simple property that is in any table?Any regular persistent property in your repository is going to be handled through GSAPropertyDescriptor or its sub-class. In case you specify property-type as a sub-class of GSAPropertyDescriptor, then in that case some additional methods like rawToReal() and realToRaw() come into picture while calling getPropertyValue() and setPropertyValue() respectively.
    rawToReal() - converts from the database value to the property value as returned by RepositoryItem.getPropertyValue(). E.g. for a property that specifies a reference to another item, we can convert the ID stored in database of an item into the RepositoryItem itself to be returned from getPropertyValue().
    realToRaw() - converts from the value given to setPropertyValue into the value given to which will actually be stored in the database. E.g. a property that specifies a reference to another item, we can convert from the RepositoryItem object passed in () to its ID.
    The above default implementations are already provided in ATG Repository APIs and if you want to customize or change the default behavior then you can extend GSAPropertyDescriptor and define that class as property-type.
    As Shaik mentioned, one GSAPropertyDescriptor customization is already there in form of EnumPropertyDescriptor which comes into picture for "enumerated" data types. It is done by not specifying the class name in property-type but through an indirect approach where a type name for a repository property can be registered with this method:
    RepositoryPropertyDescriptor.registerPropertyDescriptorClass(String typeName, Class propertyDescriptorClass)
    Hope it helps.

  • Issue in rendering CustomToolpart to select data source for custom webpart..

    I have a custom webpart in which i have added a tool part.This toolpart should allow me to select any list in the sitecollection which would be displayed on the webpage on doing apply in the webpart properties.The dropdown list with all lists is coming fine.The
    grid is diplaying as well.But in the toolpart,not in the webpart. I cant seem to segregate the two.There is also a textbox in the  toolpart in which the entered text comes in the webpart.But the same approach is failing for the gridview.Please suggest
    what to do.
    Also,i am failing at making a separate category for the toolpart by specifying [category("List settings")]..Any suggestion as to what i'm doing wrong in that are welcome too.
    Here is my webpart class and toolpart class.
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    using System.Data;
    using Microsoft.SharePoint.Utilities;
    namespace BB.WorkSpaces.Common.WebParts.CustomList
    [ToolboxItemAttribute(false)]
    public class CustomList : Microsoft.SharePoint.WebPartPages.WebPart
    [Browsable(false),
    Category("List Settings"),
    Description("Text Property")]
    // Visual Studio might automatically update this path when you change the Visual Web Part project item.
    private const string _ascxPath = @"~/_CONTROLTEMPLATES/BB.WorkSpaces.Common.WebParts/CustomList/CustomListUserControl.ascx";
    public string ListName
    get
    return _listName;
    set
    _listName = value;
    string _listName;
    public string ListValue
    get
    return _listValue;
    set
    _listValue = value;
    string _listValue;
    public GridView Gv
    get { return gv; }
    set { gv = value; }
    GridView gv;
    protected override void Render(HtmlTextWriter writer)
    base.Render(writer);
    writer.Write(ListName);
    writer.Write("<br />");
    writer.Write(ListValue);
    writer.Write("<br />");
    writer.Write(Gv);
    public override ToolPart[] GetToolParts()
    ToolPart[] allToolParts = new ToolPart[3];
    WebPartToolPart standardToolParts = new WebPartToolPart();
    CustomPropertyToolPart customToolParts = new CustomPropertyToolPart();
    allToolParts[0] = standardToolParts;
    allToolParts[1] = customToolParts;
    allToolParts[2] = new CustomToolPart();
    return allToolParts;
    public class CustomToolPart : Microsoft.SharePoint.WebPartPages.ToolPart
    DropDownList ddl;
    TextBox tb;
    protected override void CreateChildControls()
    ddl = new DropDownList();
    ddl.ID = "ddl";
    // Simply getting the lists of the current web, and displaying them in the dropdown-list.
    SPListCollection lists = SPContext.Current.Web.Lists;
    foreach (SPList list in lists)
    ddl.Items.Add(list.Title);
    tb = new TextBox();
    tb.ID = "tb";
    Controls.Add(ddl);
    Controls.Add(tb);
    base.CreateChildControls();
    public override void ApplyChanges()
    CustomList wp = (CustomList)this.ParentToolPane.SelectedWebPart;
    wp.ListName = ddl.SelectedValue;
    wp.ListValue = tb.Text;
    SPSite site = SPContext.Current.Site;
    SPWeb web = site.RootWeb;
    SPList list = web.Lists[ddl.SelectedItem.Text];
    //SPListItemCollection slist = list.GetItems();
    GridView GV1 = new GridView();
    DataTable dt = list.Items.GetDataTable();
    GV1.DataSource = dt;
    GV1.DataBind();
    this.Controls.Add(GV1);

    Hi,
    According to your post, my understanding is that you have an issue about the custom web part.
    Per my knowledge, we should customize the EditorPart instead of the
    ToolPart to bind the lists to the dropdown list.
    There is a good article about customizing web part, you can refer to it.
    http://www.concurrency.com/blog/create-a-custom-web-part-for-sharepoint-2010/
    More reference:
    http://www.enjoysharepoint.com/Articles/Details/show-all-list-in-dropdown-list-using-visual-web-part-20676.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Adding an item to a List when clicking a WebPart Properties 'OK' button

    Hi all,
    I wonder if someone can help me. Im new to SharePoint Programming but learning slowly. 
    I have a superb Web Part downloaded from Codeplex which essentially is a Countdown Timer in jQuery. (spCountdown) The code itself works perfectly however I want to tweak it, in what I thought would be a relatively easy thing to do.
    In the Web Part properties of the solution, there is a textbox where you enter the Date/Time which you wish to set the countdown timer. When I click 'OK' to submit the WebPart, I would like the date value in the textbox to be added to a List as a new List
    item. I've got the code to add the List item (or what im think is the correct code) but what I cant do is get the function to execute when the WebPart 'OK' button is clicked. 
    Now, I have downloaded the source code which is available but I cant fathom how to hook the 'Update List Item' code onto the onclick event of the button (as I cant find an onclick event!). Any help to advise me what to do would be appreciated.
    My code to add the date to the new List:
    // create item in Deadline Configuration List
    using (SPSite oSiteCollection = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb oWeb = oSiteCollection.OpenWeb())
    SPList oList = oWeb.Lists["DLConfig"];
    SPListItem oListItem = oList.Items.Add();
    oListItem["Title"] = "Deadline Date";
    oListItem["TaskDueDate"] = new DateTime(WebPart.TargetDate.Year, WebPart.TargetDate.Month, WebPart.TargetDate.Day);
    oWeb.AllowUnsafeUpdates = true;
    oListItem.Update();
    Original WebPart Code:
    SPCountdownWebpart.cs
    using System;
    using System.ComponentModel;
    using System.Web.UI.WebControls.WebParts;
    namespace SPCountdown.SPCountdownWebPart
    [ToolboxItemAttribute(false)]
    public class SPCountdownWebPart : WebPart
    // Visual Studio might automatically update this path when you change the Visual Web Part project item.
    private const string _ascxPath = @"~/_CONTROLTEMPLATES/SPCountdown/SPCountdownWebPart/SPCountdownWebPartUserControl.ascx";
    protected override void CreateChildControls()
    var control = Page.LoadControl(_ascxPath);
    if (control != null)
    ((SPCountdownWebPartUserControl)control).WebPart = this;
    Controls.Add(control);
    [Category("Countdown Settings"),
    Personalizable(PersonalizationScope.Shared),
    WebBrowsable(true),
    WebDisplayName("Target Date/Time"),
    WebDescription("Please enter the target date/time for countdown.")]
    public DateTime TargetDate { get; set; }
    SPCountdownWebpartUserControl.cs
    using System;
    using System.Web.UI;
    using Microsoft.SharePoint;
    namespace SPCountdown.SPCountdownWebPart
    public partial class SPCountdownWebPartUserControl : UserControl
    public SPCountdownWebPart WebPart { get; set; }
    public SPCountdownWebPartUserControl()
    PreRender += SPCountdownWebPartUserControl_PreRender;
    void SPCountdownWebPartUserControl_PreRender(object sender, EventArgs e)
    // parse date from properties
    var targetDateString = string.Format("{0},{1},{2},{3},{4},{5}",
    WebPart.TargetDate.Year,
    WebPart.TargetDate.Month - 1, //uses 0-based index
    WebPart.TargetDate.Day,
    WebPart.TargetDate.Hour,
    WebPart.TargetDate.Minute,
    WebPart.TargetDate.Second);
    // js sources
    const string jqueryScript = "<script type='text/javascript' src='/_layouts/SPCountdown/js/jquery-1.10.2.min.js'></script>";
    const string countdownScript = "<script type='text/javascript' src='/_layouts/SPCountdown/js/jquery.countdown.min.js'></script>";
    // create javascript implementing countdown
    const string jsCountdownFormat = "<script type='text/javascript'>$(function () {{var targetDate = new Date({0});$('#defaultCountdown').countdown({{until: targetDate}});}});</script>";
    var jsCountdown = string.Format(jsCountdownFormat, targetDateString);
    // register client scripts
    var cs = Page.ClientScript;
    if (!cs.IsClientScriptBlockRegistered("jQuery"))
    cs.RegisterClientScriptBlock(
    GetType(),
    "jQuery",
    jqueryScript);
    if (!cs.IsClientScriptBlockRegistered("jsCountdownScript"))
    cs.RegisterClientScriptBlock(
    GetType(),
    "jsCountdownScript",
    countdownScript);
    if (!cs.IsClientScriptBlockRegistered("jsCountdown"))
    cs.RegisterClientScriptBlock(
    GetType(),
    "jsCountdown",
    jsCountdown);
    protected void Page_Load(object sender, EventArgs e)
    Can anyone help me with where I need to implement my code to get the List Item to be created when the Web Part properties are set?
    Thanks in advance.
    Rick Lister
    -=Stylus=-

    Hi,
    Please refer below link regarding web part custom properties,
    I think you need to write code under ApplyChanges() Method.I am not sure. Just try it once.
    http://sharepointkitchen.blogspot.in/2014/10/custom-web-part-properties-approach-2.html
    Don't forget to mark it as an Answer if it resolves your problem or Vote Me if it useful.
    Mahesh

  • Adding Custom WebPart in AllUsersWebPart in SharePoint 2013

    Hi 
    I am trying to add the Custom WebPart to Custom PageLayout using 
    AllUsersWebPart.But the webpart is not adding to the page when created. The same code if i am adding to Pages AllUsersWebPart , its coming.Is there any thing need to do with PageLayout AllUsersWebPart property  <![CDATA[              
            <?xml version="1.0" encoding="utf-8"?>
            <webParts>
              <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
                <metaData>
                  <type name="SolutionX.ProjectY.WebParts.MyWebPart, $SharePoint.Project.AssemblyFullName$" />
                  <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
                </metaData>
                <data>
                  <properties>
                    <property name="Title" type="string">My WebPart</property>
                    <property name="Description" type="string">My WebPart for XYZ</property>
                    <property name="ListName" type="string">ExampleList</property>
                    <property name="RowLimit" type="string">5</property>
                  </properties>
                </data>
              </webPart>
            </webParts>
            ]]>
          </AllUsersWebPart>Thanks SPKids

    Hi,
    I assume you are attempting to add this to a standard page layout and not a HTML Page Layout.
    My suggestion is that you add your webpart to a standard content page in the browser first. Save the content page and check in / publishing a major version. Now open your site in SPD and navigate to the Pages library. Your content page should be listed.
    Right click this content page and "Detach" the page from its page layout. You will receive a warning, ok that.
    Once the content page has been detached from the page layout, open the content page in SPD and view the HTML source. Look for your custom webpart in the source. This is the tags / source that you need to add to your custom page layout. You can reattach this
    content page to its page layout now if you wish.
    Eric Overfield - PixelMill -
    ericoverfield.com -
    @EricOverfield

  • SPCalendarView in custom Webpart

    Hi!
    I created a custom webpart where I use dropdown list and set SPCalendarView datasource with custom filter from the selected DropDown value.
    The filter is works good. My problem is, how can I set the "Add new Event" to this SPCalendarView?
    Please help!
    Thanks,
    Mykie

    Hi,
    try this code
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    static void Main(string[] args)
    using (SPSite site = new SPSite("http://sitename"))
    using (SPWeb web = site.OpenWeb(""))
    SPList list = web.Lists.TryGetList("Calendar");
    if (list != null)
    SPListItem item = list.Items.Add();
    item["Title"] = "New Event";
    item["Description"] = "New Event";
    item["Location"] = "room1";
    item["Start Time"] = DateTime.Now;
    item["End Time"] = DateTime.Now.AddDays(1);
    item["Category"] = "Business";
    item["fAllDayEvent"] = false;
    item.Update();
    else
    System.Console.WriteLine("error");
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • Excel data read from users and upload in to Oracle DB using custom webpart

    Hi Team,
    I need to get the excel date from user using file upload control and read the data from the excel using custom webpart and validate the each rows whether having the values or not and need to upload the data to the oracle database.
    Can you please let me know the best approach to read the data from excel using sharepoint custom webpart.
    Thanks,
    Mylsamy

    Hi,
    According to your post, my understanding is that you want to read excel data from the uploaded file and insert the data into Oracle Database.
    The following way for your reference:
    1.Create a Visual Web Part using Visual Studio.
    2. Add an asp.net upload control into the .ascx file.
    <div>
    <asp:FileUpload ID="fileupload" runat="server" />
    <asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click" Text="Upload" />
    </div>
    3. Add some logic methods into .ascx.cs file.
    protected void btnUpload_Click(object sender, EventArgs e)
    //read data and insert the data into Oracle database.
    4.We can create a web service for adding data to Oracle database, then consume this web service in the visual web part.
    More information:
    http://msdn.microsoft.com/en-us/library/ff597539(v=office.14).aspx
    http://manish4dotnet.blogspot.in/2013/02/upload-ans-read-excel-file-using-c.html
    http://msmvps.com/blogs/windsor/archive/2011/11/04/walkthrough-creating-a-custom-asp-net-asmx-web-service-in-sharepoint-2010.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Access denied error on updating list through custom webpart

    hi
    I have created one webpart having multiple view option.
    On selection of items from one view user is clicking on next button to get 2nd view (THis is causing postback) and on selection of 2nd view items user is clicking on next buton for 3rd view.
    On third view he can see the submit button. On click on submit button the selected items are updateing in one list and also updating data in other lists.
    The list in which we are updating data have limited access to all users. But previously user were able to upate the list.
    But after implimenting this multiple view with next button which  postbacks on click user are getting access denied error while updating the list. If i provide contribute access to that list then they able to submit the changes properly. But even after
    that they got the error at first time.
    Any body got this type of issue?
    Is the post back on custom webpart cause access denied error?
    i have written my code like this to updat list,
    protected void btnUpdate_Click(object sender, EventArgs e)
    try
    SPSite site = new SPSite(SPContext.Current.Site.ID);
    SPWeb myWeb = site.OpenWeb(SPContext.Current.Web.ID);
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite ElevatedSite = new SPSite(site.ID))
    using (SPWeb ElevatedWeb = ElevatedSite.OpenWeb(myWeb.ID))
    ElevatedSite.AllowUnsafeUpdates = true;
    ElevatedWeb.AllowUnsafeUpdates = true;
    //code to update multiple lists
    catch (Exception ex)
    Please suggest any solution for this.

    Yes I checked with ULS log viewer.
    Its very helpfull as reading that text log file is very difficuelt.
    I found that if user spend more time on that webpart then session veriables on that webpart gets expired and at the time of redirection of user to newly created list using below code currentNewList becomes empty and its redirection to wrong list(_abc) which
    is dummy list and user dont have any access.
    currentNewList = NewListName+ "_abc"
    SPUtility.Redirect(currentNewList.DefaultViewUrl, SPRedirectFlags.Default, HttpContext.Current);
    So I modified the code to reload the session data when user clisk on submit button.

  • Webpart properties reset to saved when changed

    Hello!
    Is there any way to prevent saving of webparts?
    We have a problem with our custom master-page (JS, CSS, custom webparts included) - when we save changes in any webpart and any field (and not customized too) it resets to a previously saved value. When we set default master - there is no such problem.
    So we are trying to locate any places that could corrupt default saving logic, so if you can point on as many ways to prevent changes saving (using only master & custom webparts, no changes in settings) - it would be really helpful.
    Or maybe someone encountered such problem before?

    Hi,
    Based on your description, my understanding is that when you changed the webpart properties and saved it,  it reset to a previously value.
    As the issue only occurs with the custom master-page, maybe in the custom code the default values were being forcefully placed in the properties. So you need to troubleshot your custom master-page's code. 
    Here are some similar posts you can use as a reference:
    https://social.msdn.microsoft.com/Forums/en-US/6bc6226b-f58a-4ac9-8da6-024c7a88258d/web-part-properties-lost-when-saving-page?forum=sharepointdevelopmentprevious
    https://social.msdn.microsoft.com/Forums/en-US/5777b8fb-7251-4736-a424-220b31e8e7de/web-part-property-not-saving-value?forum=sharepointdevelopmentprevious
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Create a Fancy Custom Control

    I'm trying to create a fancy Custom Control for processing Cell Counter images.  I want a Control that lets me select two image types, Fluorescent or DAB, and if I choose Fluorescent, will let me pick Red, Green, or Blue.
    I created two Radio Button controls, one for Fluorescent/DAB, one for RGB, that look like this:
    I was hoping to "embed" the RGB control inside the Image Type control, yet have them retain their properties (a 2-element and 3-element Dialog Box).  When I did the simple drag-and-drop of RGB onto Image Type, it acted as though I added elements to a cluster, and I had a 5-element Dialog Box, not what I wanted.
    So I got clever and dragged Image Type on top of RGB.  Of course, if Image Type is in front, you don't see RGB.  However, if RGB is in front, you see both, but with ugly shadows around RGB (I made its label invisible).
    Anyone have an idea how I can Have my Cake and Eat It, Too?  Specifically, how can I get rid of the shadow that the RGB control casts on the Image Type control?
    Here are the controls, themselves, as snippets:
    Bob Schor
    Solved!
    Go to Solution.

    Duh ...  Thanks, Lynn!  Here is the result:
    Bob Schor

  • Using CreatedModifiedInfo in custom webpart SharePoint 2013

    We've used those lines of code in SharePoint 2010 for a long time and we never had any issues with them. We've created a custom webpart and added the modifiedinfo toolbar to the bottom. Now we've moved our site from SP2010 to a SP2013 while still using SP2010
    UI. So we're still in 2010 mode while this problem occurs.
    internal static void AddToolBarInfo(this ToolBar toolBar, SPControlMode mode)
    info = new CreatedModifiedInfo();
    info.ControlMode = mode;
    toolBar.Buttons.Controls.Add(info);
    The control is added properly but no information are shown inside the toolbar. Somehow not many persons have used this toolbar, so I'm not able to find many informations about it. Since we've never done more than adding the control, I don't know where to
    start looking when the control is not properly filled.
    Regards Andreas MCPD SharePoint 2010. Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.

    Has anyone used the CreatedModifiedInfo before in his code?
    Regards Andreas MCPD SharePoint 2010. Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.

  • How to create dropdown box, radio button,check box in wad

    Hi,
    How to create dropdown box, radio button,check box in wad.
    Thanks,
    cheta.

    Cheta,
    This are all standard Web Items in the WAD. Drag them onto your template and then make the changes you need to them in their Properties.
    Regards
    Gill

  • Linking Custom Document Properties to SharePoint

    We currently have a Microsoft Office Add-in that, among other things, reads and writes Custom Document Properties. Our add-in includes a user-dialogue through which these values are captured and subsequently displayed within the document.
    We now have a requirement to integrate this functionality with SharePoint 2010. In particular, we want our Office custom document properties to be co-ordinated with equivalent SharePoint server properties (i.e. site columns in Document Libraries) so that,
    when a given SharePoint property value is changed the equivalent custom document property is also changed.
    Users must be able to set the properties in either SharePoint or in an Office App (Word for example) and the changes be reflected in both places.
    Our solution must work with the desktop versions of Office 2010/13 and the non-Office365 versions of SharePoint 2010/13.
    During our initial prototyping we have looked at a number of possible approaches (including Document Property Promotion and Demotion) but are still not sure which appropriate to use.
    With regard to Document Property Promotion and Demotion for example, we found that, if we create a document outside SharePoint, then invoke our add-in to set document properties, then upload the document to SharePoint; the SharePoint properties and the
    Office Custom Document Properties are initially in step, any subsequent changes cause problems.
    If we now change the SharePoint properties by editing them in SharePoint and then open the document in Word, the Custom Document Properties are unchanged. Similarly, any change we make in Word is not reflected in the
    SharePoint properties when the document is saved back to the SharePoint library.
    Our properties are all of type string in Word and type Choice in SharePoint.
    For various reasons, our solution must not depend in any way on Office templates.
    We would like to know what would be the recommended approach to implementing this functionality.
    Below provides a basic diagram of our requirement:

    Hi,
    According to your description, you might want to sync the custom document properties between document and SharePoint Library.
    A solution can be like this: We can add an Event Receiver to this library, it will be triggered when there is a file is checked in or the item of list is updated, then we can
    read/write the specific document properties and sync between document and SharePoint Library.
    The whole scenario would be like this: When a document is uploaded and checked in, the method put in the Event Receiver will be triggered and update the related columns of library.
    When we updated these columns in library, we can capture the ItemUpdated event and update the corresponding properties of this document.
    Here is a step by step sample on creating a simple Item added event receiver:
    http://msdn.microsoft.com/en-us/library/ff398052.aspx
    More information on Event Receiver for your reference:
    http://msdn.microsoft.com/en-us/library/gg749858(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/ff408183(v=office.14).aspx
    For about how to update the custom properties of an Office Document, it is recommended you post another question to the Microsoft Office for Developers forum, you will get more
    help and confirmed answers from there.
    http://social.msdn.microsoft.com/Forums/office/en-US/home?category=officedev
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Problem in adding custom metada properties

    Hi All,
    I want to add some custom properties while creating a document in KM repository. I am getting problem while adding the custom group in the property structure "all_groups"...
    This is waht i have done so far,
    1) I created the custom metadata properties..
    2) Created one property struture group XXX and added all the metadata properties in the gruop items field...
    3) Added this structure group in all_groups. While saving the changes, its saying "<b>These changes would introduce problematic settings: Group item "XXX" is neither a property ID nor a group name defined in the configuration. Check whether it is the ID of an unmodelled property or the ID is misspelled. Click on OK or Apply to confirm these changes. </b>"
    After saving it, following massege is displayed, 
    "<b>The following configuration objects have some invalid or problematic properties: "all_groups</b>"..
    Also the newly created structure is not getting displayed in the document properties.
    Please help me.
    Regards,
    Sandip<i></i>
    Message was edited by: Sandip Agarwal

    Hi Robert,
    Thanks for your reply. I guess I have taken care of the spelling (have done it 4-5 times )....So may be something else is wrong.
    I have sent you a screen shot of the problem to your mail id
    Thanks again for you help.
    Regards,
    Sandip
    Message was edited by: Sandip Agarwal

  • Custom metadata properties give no results after upgrade from 2010

    Hi,
    Although I see my custom managed properties in my Search Schema in Central Admin, I am unable to find results using them e.g. 'VendorName:Marcel'. I have tried changing the column value in a document and performed a full crawl, but still no results. General
    searches such as 'Marcel' work fine and even something like 'author:marcel' (which is a built in managed property) works too. What am I missing? How can I determine the issue? Nothing stands out in the ULS logs.
    Background:
    I recently upgraded my managed metadata service and search service from 2010 to 2013.
    I then upgraded the content db holding my root site collection, and had to re-create my search service proxy to get searches to work. I then upgraded the content db which holds my content hub site collection. This includes site columns, many of which
    are also Managed Properties.
    Crawls are running with 8 errors - none of which are for the document I changed. Warnings are mainly about 'png' files.
    In 2010 I had scopes, which I no longer see in Central Admin. Although I have converted the content database without error, I have not converted the Site Collection to 2013 yet.
    macrel

    I had to set each metadata property 'queryable' property and then run a full crawl after which the results were returned. I am surprised that this did not come over from the upgrade of the search service.
    macrel

Maybe you are looking for