This message was discovered on ASPFriends.com 'aspngdatagridrepeaterdatalist' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Bill Bassler |
I've seen this done with templates, however can I apply a template to just one column and leave to rest as asp:BoundColumns???
<asp:datagrid id="grid" runat="server" DataKeyField="AgreementMaster_ID" font-names="verdana" font-size="x-small" BorderWidth="1" BorderColor="black" BorderStyle="solid" GridLines="None" CellSpacing="2" CellPadding="2" BackColor="white" CssClass="shadow" AutoGenerateColumns="false"> <AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle> <ItemStyle BackColor="Beige"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="Brown"></HeaderStyle> <Columns> <asp:BoundColumn DataField="CustomerName" HeaderText="Customer Name"></asp:BoundColumn> <asp:BoundColumn DataField="ProductLineType" HeaderText="Product Line"></asp:BoundColumn> <asp:BoundColumn DataField="StartTerms" HeaderText="Start Terms"></asp:BoundColumn>
**************************************************************************** ******** I'd like to add a column here with concatenated value of 2 database fields e.g. first name + last name column **************************************************************************** ******** <asp:HyperLinkColumn Target="frInfo" DataNavigateUrlField="AgreementMaster_ID" DataNavigateUrlFormatString="WarrantyReport.aspx?id={0}" DataTextField="AgreementMaster_ID" HeaderText="Details" DataTextFormatString="Details on {0}"> <ItemStyle Font-Bold="True" BackColor="LightBlue"></ItemStyle> </asp:HyperLinkColumn> </Columns> </asp:datagrid>
|
|
| |
| |
| Marcie Jones (VIP) |
Yep, you can just do one TemplateColumn, and leave the rest as BoundColumns.
Datagrid Girl
--- Bill Bassler <Click here to reveal e-mail address> wrote: [Original message clipped]
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
|
|
| |
|
| |
| Bill Bassler |
Just like the DataGrid Girl says:
you can just do one TemplateColumn, and leave the rest as BoundColumns.
<asp:datagrid id="grid" runat="server" DataKeyField="AgreementMaster_ID" font-names="verdana" font-size="x-small" BorderWidth="1" BorderColor="black" BorderStyle="solid" GridLines="None" CellSpacing="2" CellPadding="2" BackColor="white" CssClass="shadow" AutoGenerateColumns="false"> <AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle> <ItemStyle BackColor="Beige"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="Brown"></HeaderStyle> <Columns> <asp:BoundColumn DataField="CustomerName" HeaderText="Customer Name"></asp:BoundColumn> <asp:BoundColumn DataField="ProductLineType" HeaderText="Product Line"></asp:BoundColumn> <asp:BoundColumn DataField="StartTerms" HeaderText="Start Terms"></asp:BoundColumn> <asp:TemplateColumn HeaderText="Warranty Period"> <ItemTemplate> <asp:label id=Label2 style="MARGIN-LEFT: 5px; MARGIN-RIGHT: 5px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Duration") + " " + DataBinder.Eval(Container.DataItem, "DurationType") %>'> </asp:label> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="AgreementDate" HeaderText="Agreement Date"></asp:BoundColumn> <asp:HyperLinkColumn Target="frInfo" DataNavigateUrlField="AgreementMaster_ID" DataNavigateUrlFormatString="WarrantyReport.aspx?id={0}" DataTextField="AgreementMaster_ID" HeaderText="Details" DataTextFormatString="Details on {0}"> <ItemStyle Font-Bold="True" BackColor="LightBlue"></ItemStyle> </asp:HyperLinkColumn> </Columns> </asp:datagrid> "Marcie Jones" <Click here to reveal e-mail address> wrote in message news:692408@aspngdatagridrepeaterdatalist... [Original message clipped]
|
|
| |
|
|
|
|
|