ItemStyle-With property does nothing!

Discussion in 'ASP .Net Datagrid Control' started by, Nov 18, 2005.

  1. Guest

    This is driving me crazy. I have a page (pageA) with a datagrid. The
    datagrid's width, with no formatting is wider than the screen and no
    matter how i try to set the width of a bound column, it will not
    change. I have another page (pageB) with a datagrid that is smaller
    than the width of the screen and if I change the width of a column on
    that one, it works. Can anyone help me figure out why? I have
    included my pageA code if anyone wants to take a look. Thanks.

    <%@ Page Inherits="variance" Src="variance.vb" %>
    <title>Variance Report for RRDD: <% Response.Write(Session("RRDD"))
    <link href="styles.css" rel="stylesheet" />

    <form runat="server" language="vb">
    <table width="100%" border="0" cellspacing="0" cellpadding="0"
    <td><img src="Images/header_top.gif" width="450" height="142"
    alt="Customer Counter Web System" /></td>

    <table border="0" cellspacing="0" cellpadding="10">
    <td align="center">
    <p><asp:Label id="lblGMA" runat="server" /><br />
    <asp:Label id="lblUserName" runat="server" /><br /></p>

    <asp:Image id="imgHome" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlHome" NavigateUrl="index.aspx" runat="server"
    Text="Home" />

    <asp:Image id="imgUnmatched" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlUnmatched" NavigateUrl="unmatched.aspx"
    runat="server" Text="Unmatched Envelopes" />

    <asp:Image id="imgVariance" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlVariance" NavigateUrl="variance.aspx"
    runat="server" Text="Variance Report" />

    <asp:Image id="imgFollowups" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <!-- Leave the Navigate Url out until I figure out what their
    access level is -->
    <asp:HyperLink id="hlFollowups" runat="server" Text="Follow-Ups" />

    <asp:Image id="imgAdjustments" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <!-- Leave the Navigate Url out until I figure out what their
    access level is -->
    <asp:HyperLink id="hlAdjustments" runat="server" Text="Adjustments"

    <asp:Image id="imgWriteOffs" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <!-- Leave the Navigate Url out until I figure out what their
    access level is -->
    <asp:HyperLink id="hlWriteOffs" runat="server" Text="Write Offs" />

    <asp:Image id="imgReconReports" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlReconReports" NavigateUrl="recon.aspx"
    runat="server" Text="Recon Reports" />

    <asp:Image id="imgCCAdmin" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlCCAdmin" NavigateUrl="ccadmin.aspx"
    runat="server" Text="CC Administration" />

    <asp:Image id="imgReconAdmin" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlReconAdmin" NavigateUrl="reconadmin.aspx"
    runat="server" Text="Recon Administration" />

    <asp:Image id="imgSiteAdmin" ImageUrl="Images/book_closed.gif"
    runat="server" AlternateText="+" />
    <asp:HyperLink id="hlSiteAdmin" NavigateUrl="siteadmin.aspx"
    runat="server" Text="Site Administration" /> </td>
    <td valign="top">
    <h1 align="center">Customer Counter Variance for RRDD: <asp:Label
    id="lblRRDD" runat="server" /> </h1>
    <h2 align="center">Starting Collection Date: <asp:TextBox
    id="txtStartColDate" TextMode="singleline" Columns="10" runat="server"
    /> <br />
    Ending Collection Date: <asp:TextBox id="txtEndColDate"
    TextMode="singleline" Columns="10" runat="server" />
    <br />
    <asp:Button id="btnRefresh" Text="Refresh" runat="server"
    CssClass="button" />
    <br />
    <asp:CompareValidator id="cvStartColDate" Operator="DataTypeCheck"
    Type="Date" ControlToValidate="txtStartcolDate" runat="server"
    ErrorMessage="You must enter the starting collection date in the format
    mm/dd/yyyy!" /> <br />
    <asp:CompareValidator id="cvEndColDate" Operator="DataTypeCheck"
    Type="Date" ControlToValidate="txtEndcolDate" runat="server"
    ErrorMessage="You must enter the ending collection date in the format
    mm/dd/yyyy!" />

    <br />
    <asp:DataGrid id="dgVariance" runat="server"
    AutoGenerateColumns="false" CellPadding="4"
    OnItemCommand="dg_CenterDetail" OnItemCreated="dgVariance_ItemCreated"

    <ItemStyle Font-Name="Arial" Font-Size="10px" ForeColor="#000000"
    <HeaderStyle CssClass="gridheader" />
    <AlternatingItemStyle Font-Name="Arial" Font-Size="10px"
    BackColor="#CCCCCC" />
    <asp:BoundColumn DataField="Center" HeaderText="SLIC" />
    <asp:BoundColumn DataField="Shipper" HeaderText="Shipper" />
    <asp:BoundColumn DataField="Center Name" HeaderText="Center" />
    <asp:BoundColumn DataField="Cash Declared" HeaderText="Cash
    Declared" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Cash Counted" HeaderText="Cash
    Counted" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn ItemStyle-Width="500px" DataField="Cash O/S"
    HeaderText="Cash O/S" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Checks Declared" HeaderText="Checks
    Declared" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Checks Counted" HeaderText="Checks
    Counted" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Checks O/S" ItemStyle-Width="50px"
    HeaderText="Checks O/S" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Credit Cards Declared"
    HeaderText="Credit Cards Declared" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Credit Cards Collected"
    HeaderText="Credit Cards Collected" DataFormatString="{0:$#,##0.00}"
    <asp:BoundColumn DataField="Credit Cards O/S"
    ItemStyle-Width="50px" HeaderText="Credit Cards O/S"
    DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Petty Cash" HeaderText="Petty Cash"
    DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Total Collected" HeaderText="Total
    Collected" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="IShip Revenue" HeaderText="IShip
    Revenue" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Services and Packaids"
    HeaderText="Services and Packaids" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Taxes" HeaderText="Taxes"
    ItemStyle-HorizontalAlign="Right" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Gift Card Revenue" HeaderText="Gift
    Cards" DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Total Sales" HeaderText="Total Sales"
    DataFormatString="{0:$#,##0.00}" />
    <asp:BoundColumn DataField="Variance" HeaderText="Variance"
    DataFormatString="{0:$#,##0.00}" />
    <asp:ButtonColumn ItemStyle-HorizontalAlign="center"
    ButtonType="PushButton" Text="Details" CommandName="Details" />
    <br /><br />
    <!-- <asp:Button id="btnExport" Text="Export To Excel"
    runat="server" CssClass="button" align="center"/> -->

    , Nov 18, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Clive

    ItemStyle ForeColor on a datagrid

    Clive, Jul 14, 2003, in forum: ASP .Net
    Jul 14, 2003
  2. matthew schouppe
    Scott Allen
    Apr 30, 2004
  3. Paul King

    ItemStyle from DataGrid

    Paul King, Jul 21, 2004, in forum: ASP .Net
    Paul King
    Jul 21, 2004
  4. Diego
    Nov 12, 2004
  5. Devin Jeanpierre
    Devin Jeanpierre
    Feb 14, 2012

Share This Page