controls in wrong column

Discussion in 'ASP .Net Datagrid Control' started by jake, Jan 3, 2005.

  1. jake

    jake Guest

    My datagrid has several bound columns followed by a template column
    containing a checkbox(in ItemTemplate), followed by three template
    columns, each with hyperlinks(in ItemTemplate).

    The problem is that when this datagrid displays, the hyperlink columns
    are shifted over into the template column that should contain
    checkboxes. The column headings are as they should be. The last
    column is empty when it should contain hyperlinks.

    Thanks for any aid you can provide!

    <Columns>
    <asp:BoundColumn DataField="WPDESC" HeaderText="PRODUCT
    DESCRIPTION">
    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="UOM" HeaderText="UOM">
    <ItemStyle HorizontalAlign="Left" Width="35px"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="CurrUnits"
    HeaderText="YTD&lt;BR&gt;UNITS" DataFormatString="{0:N}">
    <ItemStyle HorizontalAlign="Right" Width="70px"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="CurrSales$"
    HeaderText="YTD&lt;BR&gt;SALES$" DataFormatString="{0:c}">
    <ItemStyle HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="CurrGP_Perc"
    HeaderText="YTD&lt;br&gt;GP%" DataFormatString="{0:N}">
    <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="PriorUnits"
    HeaderText="PRIOR&lt;br&gt;UNITS" DataFormatString="{0:N}">
    <ItemStyle HorizontalAlign="Right" Width="70px"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="PriorSales$"
    HeaderText="PRIOR&lt;br&gt;SALES$" DataFormatString="{0:c}">
    <ItemStyle HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="PriorGP_Perc"
    HeaderText="PRIOR&lt;br&gt;GP%" DataFormatString="{0:N}">
    <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="Diff" HeaderText="CHANGE&lt;BR&gt;$"
    DataFormatString="{0:c}">
    <ItemStyle HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="DiffPerc"
    HeaderText="CHANGE&lt;BR&gt;%" DataFormatString="{0:N}">
    <ItemStyle HorizontalAlign="Right"></ItemStyle>
    </asp:BoundColumn>
    <asp:TemplateColumn HeaderText="CHART&lt;BR&gt;SELECT">
    <ItemStyle Width="20px"></ItemStyle>
    <ItemTemplate>
    <asp:CheckBox id="chkSelection1" runat="server"></asp:CheckBox>
    <asp:Label id=hdnDataDesc Runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem, "WPDESC")%>'
    Visible="False">
    </asp:Label>
    <asp:Label id=hdnCurrSalesDollars Runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem, "CurrSales$")%>'
    Visible="False">
    </asp:Label>
    <asp:Label id=hdnCurrGP Runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem, "CurrGP_Perc")%>'
    Visible="False">
    </asp:Label>
    <asp:Label id=hdnPriorSalesDollars Runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem, "PriorSales$")%>'
    Visible="False">
    </asp:Label>
    <asp:Label id=hdnPriorGP Runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem, "PriorGP_Perc")%>'
    Visible="False">
    </asp:Label>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="BY&lt;BR&gt;CUSTOMER">
    <ItemStyle Wrap="False"></ItemStyle>
    <ItemTemplate>
    <asp:Hyperlink runat="server" ID="Hyperlink2"></asp:Hyperlink>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="BY&lt;BR&gt;SLSMN">
    <ItemStyle Wrap="False"></ItemStyle>
    <ItemTemplate>
    <asp:Hyperlink runat="server"
    ID="Hyperlinkcolumn1"></asp:Hyperlink>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="BY&lt;BR&gt;MONTH">
    <ItemStyle Wrap="False"></ItemStyle>
    <ItemTemplate>
    <asp:Hyperlink runat="server" ID="Hyperlink1"></asp:Hyperlink>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
     
    jake, Jan 3, 2005
    #1
    1. Advertising

  2. jake

    jake Guest

    Sheepishly...I figured out my own post. I had moved the column with
    checkboxes within the datagrid but forgot to move the hyperlink urls to
    the new cell locations.

    jake
     
    jake, Jan 3, 2005
    #2
    1. Advertising

  3. jake

    jake Guest

    Sheepishly...I figured out my own post. I had moved the column with
    checkboxes within the datagrid but forgot to move the hyperlink urls to
    the new cell locations.

    jake
     
    jake, Jan 3, 2005
    #3
    1. Advertising

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. Guest
    Replies:
    2
    Views:
    586
    Guest
    Nov 10, 2003
  2. Jim Hammond
    Replies:
    1
    Views:
    3,623
    bruce barker
    Nov 26, 2003
  3. Hai Nguyen
    Replies:
    0
    Views:
    404
    Hai Nguyen
    Jan 16, 2004
  4. Matthew
    Replies:
    7
    Views:
    673
    Priscilla Walmsley
    Jan 7, 2005
  5. Nathan Sokalski
    Replies:
    4
    Views:
    1,148
    Muhammad Naveed Yaseen
    Sep 5, 2007
Loading...

Share This Page