Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

show checkbox in a grid instead of true and false

Avatar of harveygs
harveygs asked on
.NET ProgrammingASP.NET
12 Comments1 Solution2532 ViewsLast Modified:
I am using a obout grid in asp.net.
The grid displays true or false for the bollean value ofthe column. OK
When clicking edit it changes to a checkbox ticked or not showing the state of the true or false in the column.OK
I want it to show a checkbox all of the time instead of showing true or false whether in or out of edit mode.
also in VB not C# please.

<%@ Page Language="VB"%>
<%@ Register TagPrefix="obout" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>
<%@ Register TagPrefix="obout" Namespace="Obout.Interface" Assembly="obout_Interface" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script language="VB" runat="server">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
		<title>Printer control v1</title>		
		<form runat="server">					
		<obout:Grid id="grid1" runat="server" folderstyle="styles\premiere_blue"  pagesize="17" scrollheight="450" CallbackMode="true" Serialize="true" AutoGenerateColumns="false" datasourceID="mydatasource">
				<obout:Column DataField="PC_ID" visible="false" ReadOnly="true" HeaderText="PC_ID" Width="10" runat="server"/>
				<obout:Column DataField="PC_Name" HeaderText="PC_Name" Width="100" runat="server"/>
				<obout:Column DataField="PR_ID" HeaderText="PR_ID" Width="80" runat="server"/>
				<obout:Column DataField="printer" readonly="true" HeaderText="printer" Width="250" runat="server"/>
				<obout:Column DataField="PR_default" HeaderText="PR_Default" Width="120" runat="server">
					<TemplateSettings  EditTemplateID="TemplateEditPR_Default" TemplateID="TemplatePR_Default" />
				<obout:Column AllowEdit="true" AllowDelete="true" HeaderText="" Width="150" runat="server" />
				<obout:GridTemplate runat="server" ID="TemplatePR_Default" ControlID="chkPR_Default" ControlPropertyName="checked" UseQuotes="false">
					======	WANT CHECKBOX HERE showing state of true or false=======
				<obout:GridTemplate runat="server" ID="TemplateEditPR_Default" ControlID="chkPR_Defaultedit" ControlPropertyName="checked" UseQuotes="false">
						<input type="checkbox" id="chkPR_Defaultedit">
		<asp:SqlDataSource runat="server" ID="printerdropdown" SelectCommand="SELECT DISTINCT pr_name FROM printerlist ORDER BY pr_name ASC"
		 ConnectionString="<%$ ConnectionStrings:printerConnectionString %>"></asp:SqlDataSource>
		<asp:SqlDataSource runat="server" ID="mydatasource"
			updateCommand="UPDATE PCList SET PC_Name=@PC_Name,PR_ID=@PR_ID,PR_Default=@PR_Default WHERE PC_ID = @PC_ID"
			SelectCommand="SELECT PC_ID, PC_Name,PR_ID, PR_Default,(SELECT PR_Name FROM PrinterList WHERE (PCList.PR_ID = PR_ID)) AS printer FROM PCList order by pc_name "
			Insertcommand="insert into PCList (PC_Name,PR_ID,PR_Default) values (@PC_Name,@PR_ID,@PR_Default) " 
			deletecommand="delete from pclist  where pc_id=@pc_id"
			ConnectionString="<%$ ConnectionStrings:printerConnectionString %>">
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
Avatar of CtrlAltDl
CtrlAltDlFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answers