Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<asp:DataGrid
id="dgWorkShops"
runat="server"
ShowHeader="false"
DataKeyField="wksID"
AutogenerateColumns="false"
align="left" BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px" BackColor="#ffffcc" CellPadding="4">
<ItemStyle ForeColor="#330099" horizontalalign="Center"></ItemStyle>
<HeaderStyle Font-Size="10" horizontalalign="Center" HeaderStyle>
<Columns>
<asp:BoundColumn DataField="wksID" Visible="false"/>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox id="chkID" runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="wksDate" ItemStyle-width="100px" DataFormatString="{0:d}"/>
<asp:BoundColumn DataField="wksType" ItemStyle-width="220px"/>
<asp:BoundColumn DataField="wksCity" ItemStyle-width="250px"/>
<asp:BoundColumn DataField="wksCounty" ItemStyle-width="195px"/>
<asp:BoundColumn DataField="wksState" ItemStyle-width="50px"/>
</Columns>
</asp:DataGrid>
Sub OnCheckOut( s As Object, e As EventArgs )
Dim i As Integer
Dim blnIsChecked As Boolean
For i = 0 to dgWorkShops.Items.Count - 1
blnIsChecked = DirectCast(dgWorkShops.Items(i).Cells(4).FindControl("wksID"), Web.UI.WebControls.CheckBox).Checked
If blnIsChecked = True Then
response.write( i & " IS Checked <BR>")
response.write("<BR>")
Else
response.write( i & " IsNotChecked ")
response.write("<BR>")
End If
Next
End Sub
Sub OnCheckOut( s As Object, e As EventArgs )
Dim i As DataGridItem
For Each i In dgWorkShops.Items
Dim cb_Selected As CheckBox = CType(i.FindControl("chkID"), CheckBox)
If cb_Selected.Checked Then
response.write( i & " IS Checked <BR>")
response.write("<BR>")
Else
response.write( i & " IsNotChecked ")
response.write("<BR>")
End If
Next i
End Sub
Sub OnNext (sender as object, e as EventArgs)
Dim selectedRows as ArrayList
selectedRows = new ArrayList()
Dim aitem as DataGridItem
for each aitem In DataGrid1.Items
Dim chkBox as CheckBox
chkBox = aitem.FindControl("selectRow")
if (chkBox.Checked)
dim id as Textbox
id = aitem.FindControl("ID")
selectedRows.Add(ID.Text)
end if
next aitem
if (selectedRows.Count > 0)
dim nextURL as Stringbuilder
nextURL = new StringBuilder ("printquote.aspx?")
Dim productID as string
for each productID in selectedRows
nextURL.Append("ID=")
nextURL.Append(productID)
nextURL.Append("&")
next productID
Response.Redirect(nextURL.ToString())
End if
End Sub
Dim i As Integer
Dim k As Integer = 0
Dim strURL As String
Dim blnIsChecked As Boolean
For i = 0 to dgWorkShops.Items.Count - 1
blnIsChecked = DirectCast(dgWorkShops.Items(i).Cells(1).FindControl("chkID"), Web.UI.WebControls.CheckBox).Checked
If blnIsChecked = True Then
If k=0 Then
strURL = dgWorkShops.Items(i).Cells(0).Text
Else
strURL = strURL & "&ID" & k+1 & "=" & dgWorkShops.Items(i).Cells(0).Text
End If
k += 1
End If
Next
Response.Redirect("Confirm.aspx?ID=" & strURL & "," & "&Ct=" & k)
End Sub
Dim strWHERE As String
Dim i As Integer
Private Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
'build the WHERE string for the SQL Command statement...
For i = 1 to Request.QueryString("Ct")
If Request.QueryString("Ct") = 1 Then
strWHERE = Request.QueryString("ID1")
ElseIf i = 1 Then
strWHERE = Request.QueryString("ID1") & " OR wksID="
ElseIf i < Request.QueryString("Ct") Then
strWHERE = strWHERE & Request.QueryString("ID" & i) & " OR wksID="
ElseIf i = Request.QueryString("Ct") Then
strWHERE = strWHERE & Request.QueryString("ID" & i)
End If
Next i
'open database...
Dim cmdSelect As OLEDbCommand
Dim cnnWk As OleDbConnection = New OleDbConnection) _
"Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("fpdb\WKshpReg.mdb;"))
cmdSelect = New OLEDbCommand("SELECT wksID, wksDate, wksType, wksCity, wksCounty, wksState _
FROM tblWkshp_Prop WHERE wksID=" & strWHERE, cnnWk)
cnnWk.Open()
dgWorkShops.DataSource = cmdSelect.ExecuteReader()
dgWorkShops.DataBind()
cnnWk.Close()
End If
End Sub
Sub btnOrder_Click(Sender as object, e As Eventargs)
'process grid, send variables to submit page..
Dim selectedRows as ArrayList
selectedRows = new ArrayList()
Dim selectedProd as ArrayList
selectedProd = new ArrayList()
Dim aitem as DataGridItem
i=0
for each aitem In dgOrders.Items
ddlist = aitem.FindControl("ddOrder")
if (ddlist.selectedindex > 0) Then
selectedRows.Add(ddlist.selectedIndex)
lblCID = aitem.FindControl("lblCatID")
dim strCD as string = lblCID.Text
selectedProd.Add(strCD)
end if
next aitem
if (selectedRows.Count > 0)
nextQty = new Stringbuilder ("?Val=")
for each qty in selectedRows
if i=0 Then
nextQty.Append(qty)
else
nextQty.Append("," & qty)
end if
i+=1
next qty
i=0
nextVar = new Stringbuilder ("&Catid=")
for each pid in selectedProd
if i=0 Then
nextVar.Append(pid)
else
nextVar.Append("," & pid)
end if
i+=1
next pid
nextURL = new StringBuilder ("ChemSubOrder.aspx")
nextURL.Append(nextQty)
nextURL.Append("&Ct=" & i)
nextURL.Append(nextVar)
end if
if selectedrows.count = 0 Then exit sub
Response.Redirect(nextURL.ToString())
End Sub