473,804 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem populating GridView!

Hey

asp.net 2.0

I have this GridView in my web page. My problem is that it get populated
with all the fields of the MembershipUser class. I thought only UserName
would be displayed, but it displays all fields

<asp:GridView ID="gvwOnline" runat="server">
<Columns>
<asp:ButtonFiel d DataTextField=" UserName" />
</Columns>
<EmptyDataTempl ate>No users are online</EmptyDataTempla te>
</asp:GridView>

MembershipUserC ollection onlineUsers = Membership.GetA llUsers();
gvwOnline.DataS ource = onlineUsers;
gvwOnline.DataB ind();

Any suggestions?
Oct 11 '06 #1
1 1375
If you want to only grab specific columns, you must set the "AutoGenerateCo lumns"
to false:
<asp:GridView ID="gvwOnline" runat="server" AutoGenerateCol umns="false">
<Columns>
<asp:ButtonFiel d DataTextField=" UserName" />
</Columns>
<EmptyDataTempl ate>No users are online</EmptyDataTempla te>
</asp:GridView>
More information here:

http://msdnwiki.microsoft.com/en-us/...tecolumns.aspx

-dl

--
David Longnecker
Web Developer
http://blog.tiredstudent.com
Hey

asp.net 2.0

I have this GridView in my web page. My problem is that it get
populated with all the fields of the MembershipUser class. I thought
only UserName would be displayed, but it displays all fields

<asp:GridView ID="gvwOnline" runat="server">
<Columns>
<asp:ButtonFiel d DataTextField=" UserName" />
</Columns>
<EmptyDataTempl ate>No users are online</EmptyDataTempla te>
</asp:GridView>

MembershipUserC ollection onlineUsers = Membership.GetA llUsers();
gvwOnline.DataS ource = onlineUsers;
gvwOnline.DataB ind();
Any suggestions?

Oct 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5045
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a GridView that needs to be dynamically designed, depending on what collection of fields our uses want to edit for their product data. We have 400+ fields of information per product so they're selecting a subset of those fields to edit.
3
6045
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
1
2048
by: Isoaxis | last post by:
On the page in question I have a gridview that displays the list of all products in the Products table of the DB. That gridview is bound with a sqldatasource using Visual Studio's "wizards". The gridview is paged at 10 rows. Anticipating the client entering in many, many products, I want to allow the products to be filtered by a dropdownlist just above the gridview containing categories/category ID's. I have tried mulitple methods for...
1
1408
by: bill tie | last post by:
I have two dropDownLists A and B outside a gridView. A selection made in ddlA causes ddlB to be populated with data from the database. The gridView is populated with data according to a selection in ddlB. ddlA --> ddlB --> gridView When a user selects an item in ddlA, I want (a) the ddlB to be populated automatically
1
2637
by: Greg Smith | last post by:
I am looking for examples for populating a GridView in code. I have a GridView that I want to show unbound when the form opens and then filled with different collections of data based on options the user selects. Any help is greatly appreciated.
0
1706
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my SQL statements in the Data Acess Layer to create more secure web service application. The Web service class is also in the Data Access Layer. I need to populates the 4 Dropdown list boxes on the web form from one table. I have Customer table which...
4
3069
by: ASPnewb1 | last post by:
Hello, I have a 2-dimensional array created from the following text file: data1=asdfawe data2=2 data3=223d data4=22
1
1382
by: Andy B | last post by:
I have a wizard with multiple steps in it. On the first step, I have a gridView that shows the users current input for that particular step. The GridView is bound to an in memory object. When I press the next button to go to the next step, and then click the link in the navbar to get back to the first step, all of the data in the gridView is gone. How do you rebind the gridview when doing stuff like that? And for that matter, How do I tell...
2
2462
by: William LaMartin | last post by:
On webform, I am populating a GridView from a SQLDatasource based on a MySQL table named PIB. There is no vb code involved. Everything is done in the source for the aspx page, provided below. The update works fine, but a delete of a row produces the following error: Exception Details: System.Data.Odbc.OdbcException: ERROR SQLBindParameter not used for all parameters
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.