I have attempted various methods to change the style of selected rows, such as using SelectedItemStyle and inline CSS. This is my current code:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.hoverTable tr:hover {
background-color: wheat;
}
.hoverTable tr:current {
background-color: aquamarine;
}
.SelectedTable {
background-color: aquamarine;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="divGrid" style='width:920px; height:230px; overflow:auto'>
<asp:DataGrid ID="DataGrid_ClaimSearch" runat="server"
AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="false"
CssClass="hoverTable" OnSelectedIndexChanged="OnSelectedIndexChanged"
OnCancelCommand="DataGrid_ClaimSearch_CancelCommand"
OnUpdateCommand="DataGrid_ClaimSearch_UpdateCommand"
OnEditCommand="DataGrid_ClaimSearch_EditCommand ">
<AlternatingItemStyle Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<EditItemStyle BackColor="#999999" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<PagerStyle BackColor="#5D7B9D" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<SelectedItemStyle BackColor="Teal" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<Columns>
<asp:EditCommandColumn ButtonType="PushButton" CancelText="Cancel"
EditText="Select" UpdateText="Update"></asp:EditCommandColumn>
<asp:BoundColumn HeaderText="Status" DataField="Status" />
<asp:BoundColumn HeaderText="LPI Review Date" DataField="Status_Date" />
<asp:BoundColumn HeaderText="LPI State" DataField="LPI_STATE" />
<asp:BoundColumn HeaderText="Paid Date" DataField="Claim_Paid_Date" />
<asp:BoundColumn HeaderText="Paid Amount" DataField="Claim_Paid_Amount" />
<asp:BoundColumn HeaderText="LPI Amount" DataField="Total_LPI_Amount" />
<asp:BoundColumn HeaderText="LPI_ID" DataField="LPI_ID" ItemStyle-Width="0px" />
</Columns>
</asp:DataGrid>
<asp:Label ID="lblEmpty" runat="server" Visible="false" Style="font-weight:bold; font-size:large;"></asp:Label>
</div>
</asp:Content>
The styling defined in the header does not affect the selection of rows. The SelectedItemStyle tag within the GridView also does not modify the selected row's style. Even adding RowStyle-CssClass to the GridView did not yield any results. However, the tr:hover CSS works perfectly. I am struggling to find examples of changing the selected row's style when using an EditCommandColumn button. Any assistance would be greatly appreciated.
By the way, this is a portion of a C# Intranet web page project, if that information is relevant.