T
tshad
I have a datagrid where each column has both a label and a linkbutton.
I need to have the label left justified and the linkbutton right justified.
In HTML, I would have to set up 2 cells to do this.
Is there a way to accomplish this in a DataGrid (and have the text span both
columns).
What I have is:
<asp:TemplateColumn Visible="true" headerText="Bundle(10):"
ItemStyle-Width="100" ItemStyle-VerticalAlign="Top">
<itemtemplate>
<asp:Label ID="Bundle10" text='<%#
String.Format("{0:$#,##0}",Container.DataItem("Bundle(10)"))%>'
runat="server"/>
<asp:linkButton ID="Bundle10Link" text='Buy' runat="server"/>
</itemtemplate>
</asp:TemplateColumn>
I could make this into 2 TemplateColumns and but the HeaderText would only
be over the 1st column. There is no Header-Colspan attribute.
I also tried to have 2 itemTemplates inside the TemplateColumn, but I guess
you can't do that, as when I tried it, it only showed the 2nd itemTemplate.
Thanks,
Tom
I need to have the label left justified and the linkbutton right justified.
In HTML, I would have to set up 2 cells to do this.
Is there a way to accomplish this in a DataGrid (and have the text span both
columns).
What I have is:
<asp:TemplateColumn Visible="true" headerText="Bundle(10):"
ItemStyle-Width="100" ItemStyle-VerticalAlign="Top">
<itemtemplate>
<asp:Label ID="Bundle10" text='<%#
String.Format("{0:$#,##0}",Container.DataItem("Bundle(10)"))%>'
runat="server"/>
<asp:linkButton ID="Bundle10Link" text='Buy' runat="server"/>
</itemtemplate>
</asp:TemplateColumn>
I could make this into 2 TemplateColumns and but the HeaderText would only
be over the 1st column. There is no Header-Colspan attribute.
I also tried to have 2 itemTemplates inside the TemplateColumn, but I guess
you can't do that, as when I tried it, it only showed the 2nd itemTemplate.
Thanks,
Tom