checkBoxField on gridView

G

Guest

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.
 
G

Guest

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?
 
G

Guest

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.
 
B

bhawin13

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top