Grid View for ASP.NET Web Forms - How to display a command or custom button in hot-tracked rows only
This example demonstrates how to use CSS classes to hide command or custom buttons and display them in hot-tracked rows only.
Set the grid's EnableRowHotTrack property to true
to allow the grid to highlight hot-tracked rows.
<dx:ASPxGridView ID="gridView" runat="server" ... >
<!-- ... -->
<SettingsBehavior EnableRowHotTrack="true" />
</dx:ASPxGridView>
Create a button and specify its visibility in a CSS class. To display the button in a hot-tracked row, add the CSS class to the grid's RowHotTrack property.
.hottrackButton {
visibility: hidden;
}
.hottrackRow .hottrackButton {
visibility: visible;
}
<SettingsCommandButton>
<EditButton RenderMode="Image" Image-IconID="edit_edit_32x32">
<Styles>
<Style CssClass="hottrackButton" />
</Styles>
</EditButton>
</SettingsCommandButton>
<Columns>
<dx:GridViewCommandColumn ShowEditButton="True" ... />
</Columns>
<Styles>
<RowHotTrack CssClass="hottrackRow"></RowHotTrack>
</Styles>
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
(you will be redirected to DevExpress.com to submit your response)