?
Solved

ASP.net VB.net CheckBox template field is blank

Posted on 2016-09-21
4
Medium Priority
?
64 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 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