Asp.Net C#Gridview编辑 - 更新后已经更新了彩色单独的行 [英] Asp.Net C# Gridview Editing - After update already updated rows in coloured seperate
本文介绍了Asp.Net C#Gridview编辑 - 更新后已经更新了彩色单独的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在程序中有一个可编辑的GridView。在更新后进行编辑后发生回发。我需要显示哪些行未使用其他颜色进行编辑和更新
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
<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>
推荐答案
这是你必须用某种旗帜自己跟踪的东西。然后,可能在RowDataBound事件中, https ://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview_events(v = vs.110).aspx [ ^ ],你可以查看标志,然后根据需要更改颜色或样式。
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.
这篇关于Asp.Net C#Gridview编辑 - 更新后已经更新了彩色单独的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文