You must Sign In to post a response.
  • Category: .NET

    How to create editable gridview in

    i have one dropdownlist in run time. i want to edit that dropdownlist.

    In run mode as follows

    Corusename Dropdownlist (AFF)

    In dropdownlist aff is there i want to edit that AFF value

    for that how can i do in using c#.
  • #761478
    Hello Rao,

    You can use the the update query on some button event in gridview to update the data by fetching the id of row and other information.

    Dhiraj C. Solanki

  • #761495

    Use OnRowCommand Event of gridview and pass CommandName and CommandArgument properties for link button and using those properties you can achieve your goal.

    Refer below sample

    <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" OnRowCommand="gv_OnRowCommand"> <Columns> <asp:TemplateField HeaderText="Edit" > <ItemTemplate> <asp:LinkButton ID="lnkEdit" runat="server" Text='Edit' CommandName="Edit" CommandArgument='<%#Eval("Id")%>' />
    </ItemTemplate> </asp:TemplateField>

    and In Code Behind onRowcommand event of gridview do whatever you want.

    protected void gv_OnRowCommand(object sender, GridViewCommandEventArgs e)
    //perform your action on here

    Hope this will helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #762564

    Make auto generate edit button to true.
    And handle the event onRowEditing. Place your code in this event to edit.
    The rows will automatically changes to textboxes in order to make edit your values.


    Sai Krishna Reddy.

  • Sign In to post your comments