Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey there,

I have a Asp.net gridview in which i am not able to perform these operations.Is there any other grid which can be used to perform these actions with not much hectic coding?...
Posted

This goes in your aspx page.

<pre lang="xml"><asp:GridView ID="SimpleGridView" runat="server" AutoGenerateColumns="False"
            AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
            onrowdeleting="SimpleGridView_RowDeleting"
            onrowediting="SimpleGridView_RowEditing">
        <Columns>
            <asp:CommandField />
            <asp:TemplateField HeaderText="Company Code"></asp:TemplateField>
            <asp:TemplateField HeaderText="Company Name"></asp:TemplateField>
            <asp:TemplateField HeaderText="Company Value"></asp:TemplateField>
        </Columns>
    </asp:GridView>



Here you capture your edit, and deleted events.

C#
protected void SimpleGridView_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
    protected void SimpleGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {

    }
 
Share this answer
 
Comments
AmitChoudhary10 16-Sep-10 7:44am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
Bardy85 16-Sep-10 7:49am    
Thanks,

Yeah gridviews can get quite tricky when starting off, but once you used to them, you'll never go back.
One of the best and easiest ways to shows data.
Why are you not able to preform these operations in ASP.net Gridview?
 
Share this answer
 
Comments
AmitChoudhary10 16-Sep-10 7:18am    
don't know ?..

but it seems pretty hectic...

can u help me with how to perform these operations on each row and values also get updated in the database with ASP.net ?...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900