• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

gridview checkedbox

I am trying to convert/set a column in my gridview to be a checkbox

i have tride looking things like

Gridview1.Columns[1].ControlStyle("CheckedBox");

but this does not exist.

can anybody help.

I am not looking to do this in asp <ItemTemplate>


0
Mr_Shaw
Asked:
Mr_Shaw
  • 3
  • 2
1 Solution
 
CodeCruiserCommented:
If you are using a DataTable as the datasource of the grid, setting the column type in datatable to boolean automatically creates a checkbox column in the grid.
0
 
Mr_ShawAuthor Commented:
is this the same if i am using a dataset populated from a query
0
 
CodeCruiserCommented:
YES. Given that the type of the column is Boolean.
0
 
CodeCruiserCommented:
Or Bit in SQL Server. If its not then you can manualy set it up.
0
 
Mr_ShawAuthor Commented:
Spot on...

I changed the SQL data type to a bit...

this ensures that it will always be in the right format.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now