Practical Web Applications for Daily Living…
jobs
Populating Gridview using Rowdatabound Event
Nov 24th
The Html Code
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label2" runat="server" Text="Order Total"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="OrderTotalTxt" runat="server" Text="Label"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Text="Order Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="OrderDateTxt" runat="server" Text="Label"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
the code behinde vb.net
Loading the Grid
OrderGrid.DataSource = ObjectOrder.GetOrdersAdminAll()
OrderGrid.DataBind()
End Sub
Populating during Rowdatabound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim OrderTotalTxt As New Label
OrderTotalTxt = DirectCast(e.Row.FindControl("OrderTotalTxt"), Label)
OrderTotalTxt.Text = OrderGrid.DataKeys(e.Row.RowIndex).Values("OrderTotal").ToString()
TotalAmount += Convert.ToDecimal(OrderTotalTxt.Text)
Dim OrderDateTxt As New Label
OrderDateTxt = DirectCast(e.Row.FindControl("OrderDateTxt"), Label)
OrderDateTxt.Text = OrderGrid.DataKeys(e.Row.RowIndex).Values("OrderDate").ToString()
OrderDateTxt.Dispose()
OrderTotalTxt.Dispose()
ElseIf e.Row.RowType = DataControlRowType.Footer Then
NumberOfOrders.Text = OrderGrid.Rows.Count()
TotalAmountofOrders.Text = "$ " & TotalAmount
End If
End Sub
Computer programmed the Programmer
Nov 14th
I just came out from the toilet, and I just got a brilliant idea while I was dumping… I came up an idea of having a story about a computer gained an unknown demonic or unnatural energy programmed its user.
The story will start from a Programmer 26 years of aged, he had a PC which he loves so much, coming home late from work… he then go straight to his PC like a husband going straight to his wife… then suddenly… he notice something is not right.. the computer has now a mind of its own and it is the one telling him what to do…
can you finish the story??? sorry for my bad grammar… but this will be a good start… I am very sleepy now thanks…
Work in Singapore
Jul 16th
how to work in singapore in times of crisis. Many people around the world are blah. blah.. blah….
