1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding fields to the User Grid

Adding fields to the User Grid

3 posts, 0 answered
  1. Frank Hoffman
    Frank Hoffman avatar
    4 posts
    Registered:
    19 Aug 2009
    26 Aug 2009
    Link to this post
    I've looked through some older threads on how to customize the users grid found at ~/Sitefinity/Admin/CmsAdmin/Users.aspx, but I don't think I've found exactly what I'm looking for.

    I'm adding some address fields to the user profile, and I'd like these to show up in the grid.  However, it doesn't look like I can just add another bound field to the data grid with the name of my custom field.  It keeps telling me the field doesn't exist in the data source.

    Is there an easy way to do this?  Some of the threads I saw out there had quite a bit of code associated with them.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    26 Aug 2009
    Link to this post
    Hi Frank Hoffman,

    There is no easy way to do that. The solution will require to replace ManageUsers control and create a custom one with RadGrid or GridView that uses your datasource.

                GridView grid = this.container.Grid; 
                grid.DataKeyNames = new string[] { "Username" }; 
                grid.DataSourceID = dataSource.ID; 
                grid.SelectedIndexChanged += new EventHandler(usersGrid_SelectedIndexChanged); 
                grid.RowDataBound += new GridViewRowEventHandler(usersGrid_RowDataBound); 
                grid.RowDeleted += new GridViewDeletedEventHandler(grid_RowDeleted); 
                grid.RowCommand += new GridViewCommandEventHandler(grid_RowCommand); 
                 


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Frank Hoffman
    Frank Hoffman avatar
    4 posts
    Registered:
    19 Aug 2009
    26 Aug 2009
    Link to this post
    I know this is complete laziness on my part, but has anybody built a complete solution for this already?  It would be nice to drop it in place and just replace the fields I needed.
Register for webinar
3 posts, 0 answered