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.
Thanks

<%@ 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">
 
	</script>		
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
	<head>
		<title>Printer control v1</title>		
	</head>
	<body>	
		<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">
			<Columns>
				<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>
				<obout:Column AllowEdit="true" AllowDelete="true" HeaderText="" Width="150" runat="server" />
			</Columns>
			<Templates>
				<obout:GridTemplate runat="server" ID="TemplatePR_Default" ControlID="chkPR_Default" ControlPropertyName="checked" UseQuotes="false">
					<Template>
					======	WANT CHECKBOX HERE showing state of true or false=======
					</Template>
				</obout:GridTemplate>
			
				<obout:GridTemplate runat="server" ID="TemplateEditPR_Default" ControlID="chkPR_Defaultedit" ControlPropertyName="checked" UseQuotes="false">
					<Template>
						<input type="checkbox" id="chkPR_Defaultedit">
					</Template>
				</obout:GridTemplate>			
			</Templates>
			
		</obout:Grid>
		
		<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 %>">
		   <InsertParameters>                
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
		    </insertParameters>
			<UpdateParameters>                
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
		    </UpdateParameters>
			<deleteParameters>                
				<asp:Parameter Name="PC_Name" Type="String" />
				<asp:Parameter Name="PR_ID" Type="int16" />
				<asp:Parameter Name="PR_default" Type="boolean" />			
		    </deleteParameters>			
		 </asp:SqlDataSource>
		
		
		</form>
	</body>
</html>
ASKER CERTIFIED SOLUTION
CtrlAltDl

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

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros