The Community Server User Grid doesn't get enough respect. To me its a good way for communities to learn more about other members of the community at a glance. Registered users can access the Member List at http://yoursite/user/members.aspx. The page is not available to anonymous users.
The Member List page contains sophisticated filtering and sorting, but not a lot of information in the grid. This is by design, since the username is a hyperlink to the individual's profile. We can add member information to this grid pretty easily, as each record is populated by the CS User object which contains all kinds of good info, that is, if the individual supplies it in his or her profile. That's the kicker.
The /user/members.aspx page uses the /themes/default/skins/view-ForumMembers.ascx control to load the CS UserSearch control at top of the page and the grid at the bottom in the form of a CS RepeaterPlusNone control, a smart templated repeater.
We're going to add a User Full Name column to the grid and will update the RepeaterPlusNone control like any typical ASP.NET templated control.
// View-ForumMembers.ascx
<ItemTemplate>
<tr>
<td class="CommonListCellLeftMost">
<div><asp:hyperlink id="Username" runat="server" /></div>
<div id="LocationDiv" runat="server"><asp:literal id="Location" runat="server" /></div>
</td>
<td align="center" class="CommonListCell">
<asp:literal id="UserFullName" runat="server" />
</td>
.....
The source for this control is in CS.Forums.Controls.ForumMembersView. This is what we add to the control's UserList_ItemDataBound() event.
Literal UserFullName = e.Item.FindControl("UserFullName") as Literal;
if (UserFullName != null)
{
if (user.CommonNameOrUserName != null && user.CommonNameOrUserName != user.DisplayName)
UserFullName.Text = user.CommonNameOrUserName;
}
resulting in something like this
and on our way to singing along with The Youngbloods, "Come on people now. Smile on your brother, everybody get together, try to love one another right now. Right now. Right now (repeat and fade)"
[Update: My pal, Cheeseflavor Dude, corrected me on the origin of "Let's Get Together" as being written by the Youngbloods and not the Dave Clark Five as I had originally wrote. Another CS Nuglet with so much potential now in the crapper.]