473,408 Members | 1,623 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,408 software developers and data experts.

checkBoxField on gridView

I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Columns.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.
Dec 21 '05 #1
3 10321
There are many essential information that you have not provided:
1- Is your GridView built dynamically or declartively?
2- If your GridView is placed declaratively, why not add an
<asp:CheckBoxField >?
3- In which event did you place the code that you posted below?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Brad" wrote:
I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Columns.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.

Dec 21 '05 #2
Phllip,

Thanks for the information. I was building the GridView dynamically (kind
of the old fashioned way with a declared SQL data adapter and dataset, etc).

I now am using a checkBoxList which is currently working exactly the way
that I need. For this instance, I think a gridView was a bit of an overkill
possibly.

I actually prefer building the GridViews dynamically as then I feel that I
have more control over them. But I do use SQLDataAdapter when I am building
a simpel gridView.

Thanks again.

"Phillip Williams" wrote:
There are many essential information that you have not provided:
1- Is your GridView built dynamically or declartively?
2- If your GridView is placed declaratively, why not add an
<asp:CheckBoxField >?
3- In which event did you place the code that you posted below?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Brad" wrote:
I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Columns.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.

Dec 21 '05 #3
Hello

Refer 4GuysFromRolla.com or DataGridGirl.com and find article to add
check box column in data grid.

I think this will help you better.

B

Dec 22 '05 #4

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

Similar topics

6
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
3
by: mike.aes | last post by:
(ASP.net 2.0) I am using a Gridview control that is bound to a table in my SQL database. For some reason, when the Checkbox is clicked, it stores a 1 (Positive 1) in the bound field instead of a...
2
by: hazz | last post by:
Given the update query UPDATE Columns SET Include_in_Report = @Include_in_Report WHERE (ID = @Original_ID); Include_In_Report is a bit field in the table, represented as a...
1
by: graphicsxp | last post by:
Hi, I have a checkboxfield in my gridview: <asp:CheckBoxField DataField="Analysed" HeaderText ="Analysed"> <ItemStyle width="20px" /> </asp:CheckBoxField> How can I reference the field from...
0
by: dwg1011 | last post by:
I have a detailview with several fields ending with the CheckBoxField shown below: <asp:CheckBoxField DataField="aruExtraFields" HeaderText="Extra Fields?" ReadOnly="false"...
1
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my...
0
by: Gustavo Ringel | last post by:
Hi, I'm trying to get the checked/unchecked of a Gridview CheckBoxField in code. I tried to cast the row cell to a CheckBoxField and it doesn't compiles. I'm also able to get the Text of the...
0
by: Jason Huang | last post by:
Hi, How do I bind data to a GridView in my C#.Net 2.0? Given that in the GridView1 I have 3 BoundFields and 1 CheckBoxField. I can bind the DataSet to the 3 BoundFields if there's no...
0
by: Slickuser | last post by:
I want to implement a GridView that displays all records in the database & which contain CheckBoxField (true,false). Whenever this form is displayed, the user can be able to change the status of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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,...

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.