Please let me know how to use calendar and people picker in my web part user control code

Answered Please let me know how to use calendar and people picker in my web part user control code

All Replies

  • Wednesday, May 02, 2012 8:28 AM
    Moderator
     
     
    Hi sudhanshuSharma,

    Your above links have been very detailed, here are some additional:
    1、To add the normal people picker to a web part you can use Microsoft.SharePoint.UserControls.PeopleEditor
    <SharePoint:PeopleEditor ID="myPeoplePicker" runat="server" Width="300" BorderStyle="Solid" BorderColor="Black" BorderWidth="1" />

    2、Here is an article about how to use  Sharepoint default Datetimecontrol picker for custom application built in VS for Sharepoint 2007:
    http://www.c-sharpcorner.com/uploadfile/Ravish001/how-to-use-sharepoint-default-datetimecontrol-picker-for-custom-application-built-in-vs-for-sharepoi/

    Thanks,
    Lhan Han




  • Thursday, May 03, 2012 4:06 AM
     
      Has Code

    Hi Lhan,

    Datepicker has done but i m not able to create people picker...

    found this site -

    http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/

    But not getting what to write in user control web part to achieve people picker like sharepoint.

    I write 2 things in ascx file

    <%@ Register TagPrefix="spuc" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <div>
    <spuc:PeopleEditor ID="PeopleEditor1" runat="server" width="350px" AllowEmpty="true" MultiSelect="false" SelectionSet="User" />
    </div>
    But when i saw in design mode then getting error in creating control 'user' could not be set property Selection Set.

    
    sudhanshu sharma Do good and cast it into river :)

  • Thursday, May 03, 2012 5:12 AM
    Moderator
     
     Answered
    Hi sudhanshuSharma,

    You need add a reference to Microsoft.SharePoint.dll ,Please referring to the following link, and do it according to its description:
    http://blogs.msdn.com/b/ekraus/archive/2008/02/06/use-peopleeditor-people-picker-in-sharepoint-custom-app-dev.aspx

    If you still got error in design mode, you can skip it, and publish your webpart to your site, check if ok.

    Thanks,
    Lhan Han
  • Thursday, May 03, 2012 8:47 AM
     
     

    Lhan Thank:) for help although error was still thr in design mode but i am able to see people picker on web :)


    sudhanshu sharma Do good and cast it into river :)