-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Am2pm4
Message 3 in Discussion
Actuallt this is my code but still I am not able to get thevalue CODE : - <%@
Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<HTML>
<HEAD>
<title>DataGrid with Checkboxes</title>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim DS as DataSet
Dim rownum as Integer
Dim str As String = "Server=Test\NetSDK;Database=Test;" & "user id=sa;password=;" &
"Integrated Security=False;"
Dim Sql As SqlConnection = New SqlConnection(str)
Dim querystr = "select A as id ,B as name ,C as age from Emp" Dim
MyCommand As New SqlDataAdapter(querystr, Sql)
DS = New DataSet
MyCommand.Fill(DS, "tbl_DocumentType")
rownum = DS.Tables("tbl_DocumentType").Rows.Count
Response.Write(rownum.ToString())
DG_CheckBox.DataSource = DS.Tables("tbl_DocumentType").DefaultView
DG_CheckBox.DataBind()
End Sub
Sub btnSelect_OnClick(ByVal sender As Object, ByVal e As EventArgs)
Dim myDataGridItem As DataGridItem
Dim chkSelected As System.Web.UI.WebControls.CheckBox
Dim strStoreName As String
Dim strStoreID As String
lblStatus.Text = "<br>You selected the Following items:<br><br>"
Response.Write("Just Before For ")
For Each myDataGridItem In DG_CheckBox.Items
chkSelected = myDataGridItem.FindControl("chkSelection")
If chkSelected.Checked Then
Response.Write("strStoreName")
strStoreName = CType(myDataGridItem.FindControl("lblStoreName"),
Label).Text
strStoreID = CType(myDataGridItem.FindControl("hdnStoreID"),
Label).Text
lblStatus.Text += "The store name is <b>" & strStoreName & "</b>"
lblStatus.Text += " and the StoreID is <b>" & strStoreID & "</b><br>"
End If
Next
End Sub </script>
</HEAD>
<body style="FONT: 10pt verdana">
<form id="Form1" method="post" runat="server">
<h2 align="center">DataGrid with Checkboxes</h2>
<asp:datagrid id="DG_CheckBox" Width="99%" Runat="server" BorderColor="#000000"
ItemStyle-Font-Size="13px"
ItemStyle-Font-Name="verdana" ItemStyle-BackColor="Beige"
HeaderStyle-ForeColor="#ffffff"
HeaderStyle-Font-Size="13px" HeaderStyle-Font-Name="Verdana"
HeaderStyle-Font-Bold="True"
HeaderStyle-BackColor="#ff0000" AutoGenerateColumns="true">
<Columns>
<asp:TemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderText="X">
<ItemTemplate>
<asp:Checkbox ID="chkSelection" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid><input id="btnSelect" type="button" value="Select my Stores"
name="btnSelect" runat="server" OnServerClick="btnSelect_OnClick" >
<asp:label id="lblStatus" Runat="server" ForeColor="#ff0000" Font-Size="12px"
Font-Name="verdana"></asp:label></form>
<br>
<br>
<br>
<p align="center"><font size="2">Send your comments to <A href="mailto:[EMAIL
PROTECTED]">
[EMAIL PROTECTED]</A> <A
href="../../default.aspx">Back
to Article list</A>
<br>
<br>
<center><a id="LogoLink" href="<img/'>http://aspalliance.com"><img
src="http://aspalliance.com/libraryaspa/logocounter.asp?article_id=842"
border="0"></a></center>
</font>
<P></P>
</body>
</HTML>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]