What tags do you need to add within the asp:datagrid tags to bind columns manually?

Showing Answers 1 - 4 of 4 Answers

Phyo

  • Oct 20th, 2005
 

We can simply add as the following example

  Was this answer useful?  Yes

<asp:datagrid id="DataGrid1" runat="server" CssClass="content" AutoGenerateColumns="False" AllowSorting="False"
          AllowPaging="True" PageSize="25">
          <AlternatingItemStyle CssClass="GridAlternateItem"></AlternatingItemStyle>
          <ItemStyle CssClass="GridItem"></ItemStyle>
          <HeaderStyle CssClass="GridHeader"></HeaderStyle>
          <Columns>
           <asp:BoundColumn DataField="formid" SortExpression="formid" HeaderText="Form Id" Visible="False"></asp:BoundColumn>
                 <asp:BoundColumn DataField="accounttitle" SortExpression="accounttitle" HeaderText="Customer Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"></asp:BoundColumn>
           <asp:BoundColumn DataField="CreatedOn" SortExpression="CreatedOn" HeaderText="Step-1 Date &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"></asp:BoundColumn>
           <asp:BoundColumn DataField="email" SortExpression="email" HeaderText="Email Address &nbsp;&nbsp;"></asp:BoundColumn>
           <asp:TemplateColumn>
            <ItemTemplate>
             <asp:Button id="btnEmail" Runat="server" Text="Email" CommandName="email"></asp:Button>
            </ItemTemplate>
           </asp:TemplateColumn>
          </Columns>
          <PagerStyle Font-Size="XX-Small" Font-Names="Arial Black" HorizontalAlign="Left" ForeColor="#000066"
           BackColor="White" CssClass="abc" Mode="NumericPages"></PagerStyle>
         </asp:datagrid>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions