Using the SharePoint PeopleEditor in a GridView


 

All I can say is WOW.   If something as simple as the PeopleEditor takes me a week to implement and that is with having two Microsoft Premier Support cases open on it, than once I figure it out its worth writing an article on it.

 

My business requirement:

  • I need a grid view to have data bound to it, but the data won’t come until after a drop down list selects what data source it needs to use. 
  • The data source is created using a generics list object in the code behind. 
  • The PeopleEditor object must be an object where people can enter just a single name.
  • The gridview can range in size
  • It MUST be in an AJAX Update Panel

See the example below of what it should look like once it is finished.

image

 

The problems I was facing… …And the solution…

  1. JScript Error: Microsoft JScript runtime error: The value of the property ‘PickerAdjustHeight’ is null or undefined, not a Function or object.

    image

    Solution: Add the following line to the control’s front end source above the ScriptManger
                  <script type="text/javascript" src="/_layouts/entityeditor.js"></script>

  2. JScript Error: Microsoft JScript runtime error: Thevalue of the property ‘StoreOldValue’ is null or undefined, not a Function object

    image

    Solution: Add the following line to the control’s front end source above the ScriptManger
                  <script type="text/javascript" src="/_layouts/entityeditor.js"></script>

  3. Error with the People Editor:
    The target ‘ctl00$m$g_1c88d7ea_ab45_4c52_92a6_d0402a2ec996$ctl00$GridView1$ctl04$PeopleEditor2’ for the callback could not be found or did not implement ICallbackEventHandler.

    image

    Solution: The solution for this is much more complicated, I will quickly try to explain what the problem is and  how to resolve it.

First you have to understand that you can’t just add the PeopleEditor control to your GridView in the WYSIWYG editor, in fact, its not even in the tool box.  You must instead add it in code behind on each row that exists.

When you start out with an empty grid, then populate it within in runtime, you will notice there are some missing javascript functions that the gridview uses.  So you must first some how find a way to get those functions in the page when it renders.  But there is only one path that I have found that allows you to do it.  I have layed it out in VISIO so you can see what it looks like.

image

This solved my issue with this, and here is the samples.  If anyone wants a copy of my solution, please enter a post on it with your email, and I would be happy to send it to you.

image

image

 

Bill.

Categories: SharePoint or Custom Development | 89 Comments

Post navigation

89 thoughts on “Using the SharePoint PeopleEditor in a GridView

  1. Guillaume van der Geld

    This is very interesting .I wonder if I also can get the Ajax part working
    Can you send me the source code
    Many thanks upfront !!!

    • I just sent it to you.

      • Rajendra

        I need the same thing. I will be glad if you send source code to me

    • Hi Bill, Good solution ….I have the same problem . I need to use people editor in gridview control.
      Could you please send me the source code of the solution.

      thanks in advance

    • Prabhat Jana

      Can you please share with me the source code for “Using the SharePoint PeopleEditor in a GridView”

  2. Samuel

    Can you send me the source code?
    Thanks!!!

  3. Jarod

    Could you send me the source code, please?
    Thanks.

  4. Dan Cornish

    Could you also send me the source code? I’m having similar issues using a Telerik control (TreeList) but think I could benefit from seeing your solution. Thanks!

  5. seb3D

    Hi ! Could you send me the source code, please?
    Thanks.

  6. Zac

    Could you send me the source code, please?
    Thanks.

  7. cvs

    can you send me source code please?

  8. name

    Good article!

  9. Andre

    Hey, nice article. Could you also send me the source code please? I’m having a similar issue with the People Editor inside an UpdatePanel. Thanks.

  10. Hi ! Could you send me the source code, please?
    Thanks.

  11. Boris

    Hi ! Super article !!!!!
    Could you send me the source code too, please?
    Thanks.

  12. Krish

    Hi ! Can you send me the source code, please?
    Thanks much.

  13. sangeeta

    Hi..

    Can yoy please send me the source code.
    Thanks.

  14. Sergio

    hi…

    can you please send me the source code too, please?

    Thanks a lot!

  15. Jeroen

    Very nice article!

    Could you send me the source code too, facing same issue.

    Thanks a lot

  16. showkath

    Hi !

    excellent solution!, could you send to me?

    Thanks.

  17. Hi,

    Same error is coming for me. I have added people editor control in header template. Can I get your code to see how you solved it?

    Thanks
    Sanjivani

  18. Yuliya

    Hi, Could you also send me the source code please? I’m having a similar problem with the People Editor inside an UpdatePanel. Thank you.

  19. poonam

    hey hi bill,

    nice article on PeopleEditor….
    Could you email me the project….

  20. Andrej

    Hi, I’m having a similar problem.
    Could you send me the source code please?
    Thank you.

  21. haouas

    Hi, it would be great to send me the source code.
    Thank you

  22. Hi can you publish the code that adds the people editor or send me the solution. thanks v much.

  23. Thanks, excellent post.

  24. Mugdha

    Hi,

    need ur code

    Thanks in advance

  25. Selva

    Could you send me source code?

  26. Christian

    Hi ! Could you send me the source code, please?
    Thanks.

  27. Asha

    Hi,

    It’s really nice Post,Please send me Source code.

    Thanks in Advance

  28. Pranab

    Please send me the source code please. I am facing the same problem

  29. Please send me the source code. I am doing a user/page permission on grid and need your solution. Thank you

  30. Brini

    Please send me the source code please.

  31. Hello Bill,

    after endless hours of searching I came along your post.
    could you please send me the source code to solve the ICallbackEventHandler problem.

    thanks in Advance

  32. Koifish

    Hi Bill,
    I have problem with peopleeditor.
    Can you give me your solution.

    Thanks a lots.

  33. Matthieu Panisset

    Hi Bill, I have the same problem with a people editor, can you sand me the solution.
    thanks in advance.

  34. karthik

    Can you please share the code.

  35. Ramesh

    Hi,

    have same issue to people editor along with update panel, could you pls. share the source.

  36. Tony

    Awesome article,I also encounter this issue, could you send the code to me? Many thanks.

  37. Ravikumar

    Hi source code plz?

  38. Kirsten John

    This is cool :) Could you please send me a code? Thanks.

  39. Alex

    Hi Bill

    Can you share you code please, I’ve been pulling my hair out with this today. I want to use the people picker control with jqgrid

    Thanks
    Alex

  40. imm

    Nice article,Can you pls. share the code?

  41. Prabhat Jana

    This is very interesting.

    Can you please send me the source code.

    Many thanks in advance.

  42. Haithem

    Can i have a copy of this project please?

    Thank you in advance

  43. Thank you very much for this,

    Im having the same problems as you describe.

    Can you please send me the source code?

  44. chidambaram

    Hi ,
    This is very interesting.

    Can you please send me the source code.

    Many thanks in advance.

    Thanks,
    Chidambaram

  45. Hi,
    this is very interesting.
    i´m standing in front of the problem, when i add a peopleeditor dynamic i get a error (ICallbackEventHandler).

    Can you send me your source code?

    Thanks,
    Ic3mAn

  46. a

    Thanks a Ton! Solved a Big Issue.

  47. daryl Flagg

    hi, this is awsome! could you send me the code?

  48. Juan Manuel

    Hey!

    Im trying to do the same and got stuck for a while, and then i found this blog.
    Could you please send me the code?

    Thanks,
    Juan Manuel

  49. Matthieu

    I need the same thing. I will be glad if you send source code to me
    Thank you !!!

  50. Dileep

    Hi Bill, Very Good solution ….I have the similar problem . I need to use people editor in repeater control.
    Could you please send me the source code of the solution.

    thanks in advance!

  51. Vladan Obradovic

    Could you please send me the code?

    Thanks,
    VladanO

  52. Ravi

    Nice post, can you please send the source?

  53. Ziyaad Hendricks

    please send me the source

  54. Nice post!
    can you send me the code please…. Thanks!

  55. Gab

    Also i will very happy to see your code,
    Can you please sent it also to me?
    Thanks.

    Gab

  56. This p-pickin peoplepicker is a real headache. I would love to see your code for this.

  57. adrian

    please send me the source

  58. Pingback: Curia Damiano blog | SharePoint: how include the PeopleEditor control in a UpdatePanel

  59. Stefan Chonov

    Hi. Very nice article. Can you share the source code with me.

  60. ryan

    I’d love a copy of the source. Thanks!

  61. I would be interested in seeing the source code for this. Thank you!

    -Mark

  62. chakib lamzili

    Very nice article,Please send to me code.
    Thank you!

  63. Just what I needed… Can you send me the code?

  64. Mike Williams

    I am having the same issue with people picker in update panel, can you send me the source please

  65. Tamour

    Can you please send me the code

  66. Danial khan

    you gave the logical solution. pelase provide me the solutions

  67. Alex Zhang

    I am having the same issue with people picker in update panel, can you send me the source please

  68. Sadly, I don’t believe Brad looks at this anymore. He is obviously moved on to bigger and better things. His last response was nearly 4 years ago.

  69. Nani

    I am having the same issue with people picker in update panel, can you send me the source

  70. lokesh

    i have the same in infopath form.can you send me the source

  71. Ujjwal

    Hi Bill,
    Can you please email me your code? i am having similar sort of issue.

  72. Aasai

    Hi Bill,
    Can you please email me your code? i am having similar sort of issue.

  73. Hristo

    Would you, please, email me the code? Having similar issue.

  74. Lipa

    Hi Bill,
    Can you plz send me the C# code for using a sharepoint people Editor inside a gridview.

  75. Hi Bill,
    Can you please send me the c# code ?

  76. Ranjeet

    can you please send me the code?

  77. Vivek

    This is nice .I also need to implement this.Could you please send me the source code.
    Many thanks in advance!!!!

  78. sheela

    hi ,
    could you please send me the code?
    Thanks

Leave a reply to Jarod Cancel reply

Blog at WordPress.com.