Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WinExplorerView.QueryItemTemplate Event

Allows you to choose which HTML templates stored in the HtmlTemplates collection should be applied to the current card.

Namespace: DevExpress.XtraGrid.Views.WinExplorer

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event QueryWinExplorerViewItemTemplateEventHandler QueryItemTemplate

#Event Data

The QueryItemTemplate event's data class is DevExpress.XtraGrid.Views.WinExplorer.QueryWinExplorerViewItemTemplateEventArgs.

#Remarks

You can use an event’s e.Row and e.RowHandle properties to identify a card, and assign a required template to the e.Template property.

private void OnQueryItemTemplate(object sender, QueryWinExplorerViewItemTemplateEventArgs e) {
    WinExplorerView view = sender as WinExplorerView;
    bool value = (bool)view.GetRowCellValue(e.RowHandle, colAvailable);
    e.Template = value == true ? view.HtmlTemplates[0] : view.HtmlTemplates[1];
}
See Also