Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 295563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:28:09+00:00 2026-05-12T06:28:09+00:00

I have a asp:GridView and in there i have two columns , in one

  • 0

I have a asp:GridView and in there i have two columns , in one column i want to show label
but when i click an sdit button i want to show a drop down list in that particular column,
i have created the grid view like following:

<bw:GridView ID="grdProducts" AllowPaging="True" PageSize="5" AllowSorting="True" 
  CssClass="DGTable" runat="server" AutoGenerateColumns="False" DataKeyNames="LinkedProductCode"
  RowSelectingEnabled="True" RowStyle-CssClass="DGItem" SelectedRowStyle-CssClass="DGSelectedItem"
  FooterStyle-CssClass="DGFooterTR"  EditRowStyle-CssClass="DGEditItemValidator" >
  <Columns>
    <asp:BoundField DataField="LinkedProductCode" HeaderText="Product Code" ReadOnly="true" meta:resourcekey="BoundFieldResource4" />                                        
    <asp:TemplateField  HeaderText="Product Type" ItemStyle-VerticalAlign="Top">
     <ItemTemplate>
     <asp:Label ID="lbl1" runat="server" Text='<%# Bind("LinkedProductType")%>' /> 
    </ItemTemplate>
     <EditItemTemplate >
       <asp:DropDownList ID="linkedproductList" runat="server" DataSourceID="list">
       </asp:DropDownList>
     </EditItemTemplate>
    </asp:TemplateField>                                        
  </Columns>
  <SelectedRowStyle CssClass="DGSelectedItem" />
  <PagerStyle CssClass="DGPagerTR" />
  <HeaderStyle CssClass="DGHeaderTR" />
</bw:GridView>

what should i do to do it? What should i write in edit button’s click event?
Please help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:28:09+00:00Added an answer on May 12, 2026 at 6:28 am

    It depends on how you are setting up the Edit button. If you have

    <asp:Button ID="btnEdit" CommandName="Edit" runat="server" Text="Edit" />
    

    within an <ItemTemplate> in the GridView, then the Gridview will automatically go into Edit mode when the Edit button is clicked. The CommandName Edit is a special CommandName to put a GridView into edit mode.

    If you wanted to implement some specific behaviour in edit mode, then this can be achieved by setting up an OnRowEditing event handler and implement your logic here. This would look something like this

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        // Set editing on the row that raised the event
        GridView1.EditIndex = e.NewEditIndex;
    
        /* Insert specific editing logic here */
    
        GridView1.DataBind();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET GridView with a column mapped to a boolean. I want
I have asp:GridView displaying client requests using asp:SqlDataSource . I want to limit displayed
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a ASP.NET GridView that uses template columns and user controls to allow
how to join two datatable datas into one datatable to show in one gridview
I have a ASP gridview control. I have a ASP label control in the
I have an ASP.NET GridView that has four columns. The first three are typical
I have two dropdowns and a gridview (lstDivisions, lstDistricts, gridIncidents) in an asp.net page
I have an ASP.Net GridView and I want to include an Image and a
I have an asp.net gridview which is output as a table in HTML. There's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.