Solved

ASP.net VB.net CheckBox template field is blank

Posted on 2016-09-21
4
52 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Murray Brown
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:Murray Brown
ID: 41809270
Thanks very much
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

719 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