473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Quick way to add all BoundField's?

In my gridview control I want to UNCHECK "Auto-generate fields". My table
has like 30 fields. Do I have to MANUALLY add the BoundField's ONE at a
time??? Or is there an easier way?

Thanks...
Oct 5 '08 #1
4 1054
There is an easier way: don't UNCHECK "Auto-generate fields."

If you have a good reason for unchecking the option that you say you want,
perhaps you should explain yourself.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Bobby Edward" <bo***@nobody.comwrote in message
news:uy*************@TK2MSFTNGP04.phx.gbl...
In my gridview control I want to UNCHECK "Auto-generate fields". My table
has like 30 fields. Do I have to MANUALLY add the BoundField's ONE at a
time??? Or is there an easier way?

Thanks...
Oct 5 '08 #2
"Bobby Edward" <bo***@nobody.comwrote in message
news:uy*************@TK2MSFTNGP04.phx.gbl...
In my GridView control I want to UNCHECK "Auto-generate fields".
Why?
Do I have to MANUALLY add the BoundFields ONE at a time???
Yes.
Or is there an easier way?
It's one or the other... Either let ASP.NET generate the bound fields
automatically, or do it manually...

What are you actually trying to achieve here...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 5 '08 #3
automatically, or do it manually...
>
What are you actually trying to achieve here...?
I want to add custom titles, some formatting, set some properties (ie width,
etc), convert a few to template fields, etc...

Oct 5 '08 #4
"Bobby Edward" <bo***@nobody.comwrote in message
news:eM**************@TK2MSFTNGP03.phx.gbl...
>automatically, or do it manually...

What are you actually trying to achieve here...?

I want to add custom titles, some formatting, set some properties (ie
width, etc), convert a few to template fields, etc...
Changing a column's title would generally be done after the databinding has
taken place.

Formatting individual cell values would generally be done in the
RowDataBound event.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 5 '08 #5

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

Similar topics

0
by: John Smith | last post by:
When the code below runs, I get the error: "cannot convert from 'System.Web.UI.WebControls.BoundField' to 'System.Web.UI.WebControls.DataGridColumn'" Is adding a BoundField different than adding...
5
by: sck10 | last post by:
Hello, I am using the code below to set the values of a DetailsView template field using FindControl. My question is how would you find a control if its a Boundfield control? For example,...
6
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im...
3
by: sloan | last post by:
<asp:BoundField DataField="MyDate" DataFormatString="{0:d}" HeaderText="My Date" /> I have a BoundField being populuated with the "MyDate" column. The MyDate is in a strongly typed DataSet. The...
0
by: jobs | last post by:
Given the Gridview below: When I select the button "Rate" and fall into this code: How can I reference "carriercode" and other . Apparently selecting the button does not select the row. I've...
1
by: jobs | last post by:
Given the Gridview below: When I select the button "Rate" and fall into this code. How can I reference "carriercode" and others . Apparently selecting the button does not select the row. I've...
1
by: michel | last post by:
Hi, I want to add programmatically a boundfield to a gridview: <asp:GridView ID="GridView1" runat="server"> <Columns> </Columns> ..... </asp:GridView>
2
by: mohaaron | last post by:
Why does it seem like is impossible to set the width of a BoundField in a GridView. I've tried all sorts of different way to set the width and none of them work. So far the only thing I've done...
0
by: dayiku | last post by:
I am trying to retrieve values from a boundfield in a detailsview. protected void BtnViewDetails_Click(object sender, EventArgs e) { // get the gridviewrow from the sender so we...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.