R. Bandi R. Bandi - 6 months ago 42
ASP.NET (C#) Question

asp.net c# Change gridview row color after updating data

I'm working on asp.net project and I am using a GridView with

I have edit enabled on the GridView, so I want the row color to be changed after admin edit and update the row. How can I do that?

Answer Source

Nest an <AlternatingRowStyle> element between the opening and closing tags of your GridView.

<asp:GridView ID="GridView1" runat="server" >

    <AlternatingRowStyle BackColor="DarkRed" 
      Font-Italic="true" />

Link: https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.alternatingrowstyle(v=vs.110).aspx

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download