Solved

ASP.net VB.net CheckBox template field is blank

Posted on 2016-09-21
4
32 Views
Last Modified: 2016-09-21
Hi

I add a Checkbox template field to a GridView using the following code. The cells are blank and don't show any checkboxes.
What have I done wrong?

              Dim oCheckBoxField As New CheckBoxField
                        oCheckBoxField.HeaderText = "Check"
                        oGridView.Columns.Add(oCheckBoxField)

Open in new window

0
Comment
Question by:murbro
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:CraigYellick
ID: 41809187
Did you set AutoGeneratedColumns=false?  Where is the code you posted located, which event?
0
 

Author Comment

by:murbro
ID: 41809200
The code is in the Page_Load event. I did not set AutoGeneratedColumns=false
0
 
LVL 11

Accepted Solution

by:
CraigYellick earned 500 total points
ID: 41809263
Is this checkbox intended to be used for allowing the user to select multiple items in the grid? If so this is quite complicated and there are several detailed walk-throughs available. Here's one that includes selected rows highlighting:

http://www.codeproject.com/Articles/14437/Extending-GridView-by-allowing-Multiple-Selections

Here's a very simple implementation, in two parts:

http://www.niteshluharuka.com/how-to-add-a-checkbox-column-to-gridview-in-aspnet
http://www.niteshluharuka.com/how-to-get-multiple-selected-rows-from-gridview-in-aspnet
0
 

Author Closing Comment

by:murbro
ID: 41809270
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now