#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Post Display Paticular Fields in Gridview using 3-tier


    Hi all,
    In my form i have a fields

    1.sno,
    2.Name,
    3.Address,
    4.Phoneno,
    5.Dateofbirth

    Now i want to display the particular fields in Grid view like
    1.sno
    2.Name and i use Edit and Delete option in Grid view

    If i Click Edit button in grid view all the fields in my form have to edit (i.e
    sno,name,address,phoneno,dateofbirth)
    i am using Enterpriselibrary using 3-tier architecture

    can any one send me code with description

    Thank You
    Sumanth
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    119
    Rep Power
    0

    Use template columns instead of data bound column


    Hi Friends

    Please find the answer of this question:

    Use template columns instead of data bound column: eg.

    // For non editable column
    <asp:TemplateField HeaderText="User ID">
    <ItemTemplate>
    <asp:Label runat="server" ID="lblUserID" Text='<%# Eval("UserID") %>' />
    </ItemTemplate>
    </asp:TemplateField>
    // For editable column
    <asp:TemplateField HeaderText="First Name" >
    <ItemTemplate>
    <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("NAME") %>' />
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("NAME") %>' />
    </EditItemTemplate>
    </asp:TemplateField>

    Thanks
    Diya

IMN logo majestic logo threadwatch logo seochat tools logo