Dear Programmers,
I need your help. I am developing a project in ASP.NET in which I am using
VB.NET as Language. I want to add CheckBox in DataGrid. Even I am succeded in showing the checkbox in Datagrid but I am unable to give the user opportunity to select the checkboxes. The checkbox field directly checks or unchecks the checkbox by getting data from one of the column of my database. My database is in SQL Server 2000.
Please help me. I am also sending the scripting code below.
<%@ Page Language="
VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<pre>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head2" runat="server">
<title>CheckBoxField Example</title>
</head>
<body>
<form id="form2" runat="server">
<h3>CheckBoxField Example</h3>
<asp:gridview id="AuthorsGridView"
datasourceid="AuthorsSqlDataSource"
autogeneratecolumns="False"
runat="server">
<columns>
<asp:boundfield datafield="au_lname"
headertext="Last Name"/>
<asp:checkboxfield datafield="contract"
text="Contract"
headertext="Contract"/>
</columns>
</asp:gridview>
<asp:sqldatasource id="AuthorsSqlDataSource"
selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
connectionstring="server=localhost;database=pubs;i ntegrated security=SSPI"
runat="server">
</asp:sqldatasource>
</form>
</body>
</html>
</pre>
please check the code and tell me where i am doing mistake so that i shall correct it. Please Remember that I am using Visual Studio 2005 as an editor to code ASP.NET.
If you solve the problem then please tell me on the ID below
[email protected]
I will be thankful to you.
Waiting for your reply.
One of your Programmer Friend,
Zeeshan Ahmad