newbie: GridView problem

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hey

asp.net 2.0

I've got only one column in my GridView (see code below), but when I run
it... I see more columns in the GridView. These are the columns I see:
- UserName
- ProviderName
- IsOnlne
- LastPasswordChangedData
- PasswordQuestion
- IsLockedOut
- Comment
- UserName (again, but this time not as a buttonfield)
- Email
- CreationData
- IsApproved
- lastLockoutData
- LastLoginDate
- LastActivityDate

<asp:gridview ID="gvwUsers" runat="server">
<Columns>
<asp:ButtonField HeaderText="UserName" DataTextField="UserName" />
</Columns>
</asp:gridview>

private MembershipUserCollection allUsers = Membership.GetAllUsers();
protected void Page_Load(object sender, EventArgs e)
{
gvwUsers.DataSource = allUsers;
gvwUsers.DataBind();
}

I want only columns specified in the <Columns> section to be displayed.

What am I doing wrong here?

Jeff
 
Back
Top