Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an editable GridView in the program.After editing when update a post back is happening. I need to display which rows are not edited and updated with an alternate color


ASP.NET
<body>
    <form id="form1"  runat="server">
    <div>
    
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="FetchAll" TypeName="DataOperations" 
            UpdateMethod="DailyTrackInsert">
            <updateparameters>
                <asp:Parameter Name="BankID" Type="Int32" />
                <asp:Parameter Name="BankName" Type="String" />
                <asp:Parameter Name="BankLocation" Type="String" />
                <asp:Parameter Name="AccNum" Type="String" />
                <asp:Parameter Name="TypeOfFcility" Type="String" />
                <asp:Parameter Name="BankBalance" Type="Decimal" />
                <asp:Parameter Name="BookBalance" Type="Decimal" />
            </updateparameters>
        

        <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            AutoGenerateColumns="false" oninit="GridView1_Init" 
            onrowediting="GridView1_RowEditing" onrowupdated="GridView1_RowUpdated" 
            onrowcommand="GridView1_RowCommand">
            <editrowstyle backcolor="#999999" />
             <SelectedRowStyle BackColor="CornflowerBlue" Font-Bold="True" ForeColor="#333333" />
            <columns>                     
                <asp:BoundField  DataField="BankID" HeaderText="Bank Id"  />
                <asp:BoundField DataField="BankName" HeaderText="Bank Name" ReadOnly="true" />
                <asp:BoundField DataField="BankLocation"  HeaderText="Bank Location" ReadOnly="true" />
                <asp:BoundField DataField="AccNum"  HeaderText="Account Number" ReadOnly="true" />
                <asp:BoundField DataField="TypeOfFcility"    HeaderText="Type Of Facility" ReadOnly="true"/>
                <asp:BoundField DataField="BankBalance" ReadOnly="false"  HeaderText="Bank Balance" />
                <asp:BoundField DataField="BookBalance" ReadOnly="false" HeaderText="Book Balance" />
                <asp:CommandField ShowEditButton="True" />                                  
            </columns>
        
    
    </div>
    </form>
</body>
</html>
Posted
Updated 17-Dec-15 0:47am
v2
Comments
deepankarbhatnagar 17-Dec-15 6:27am    
Not getting your query. Which kind of updating you are talking about.

1 solution

This is something you'll have to track on your own with some sort of flag. Then, probably in the RowDataBound event, https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview_events(v=vs.110).aspx[^], you can check the flag and then change the color or styling as needed.
 
Share this answer
 

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