Advertisement
Advertisement
| 05.09.2008 at 01:55PM PDT, ID: 23390815 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: |
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="FormatHighPrices" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CLLDdataSQLConnectionString %>"
SelectCommand="test2" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="2" Name="ClientID" Type="Int32" />
<asp:Parameter DefaultValue="container" Name="ShipmentType" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns DataSourceID="SqlDataSource1"
AllowSorting="True">
</asp:GridView>
<%TextBox1.Text = GridView1.Columns.Count%>
</div>
</form>
</body>
</html>
--------------------------------------------------------------------
Partial Class FormatHighPrices
Inherits System.Web.UI.Page
--------------------------------------------------------------------
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
For j = 0 To e.Row.Cells.Count - 1
If IsNumeric(e.Row.Cells(j).Text) Then
If e.Row.Cells(j).Text = 1 Then
e.Row.Cells(j - 1).BackColor = System.Drawing.Color.Maroon
End If
End If
Next
End If
End Sub
--------------------------------------------------------------------
Protected Sub GridView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.DataBound
For i As Integer = 0 To Me.GridView1.Columns.Count - 1
If Me.GridView1.Columns(i).HeaderText.Trim.ToUpper.StartsWith("HOLD") Then
Me.GridView1.Columns(i).Visible = False
End If
Next
End Sub
End Class
|