Back to Devexpress

WinExplorerView.QueryItemTemplate Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-winexplorer-dot-winexplorerview.md

latest2.4 KB
Original Source

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.v25.2.dll

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

Declaration

csharp
[DXCategory("Events")]
public event QueryWinExplorerViewItemTemplateEventHandler QueryItemTemplate
vb
<DXCategory("Events")>
Public Event QueryItemTemplate As QueryWinExplorerViewItemTemplateEventHandler

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.

csharp
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];
}
vb
Private Sub OnQueryItemTemplate(ByVal sender As Object, ByVal e As QueryWinExplorerViewItemTemplateEventArgs)
    Dim view As WinExplorerView = TryCast(sender, WinExplorerView)
    Dim value As Boolean = CBool(view.GetRowCellValue(e.RowHandle, colAvailable))
    e.Template = If(value = True, view.HtmlTemplates(0), view.HtmlTemplates(1))
End Sub

See Also

WinExplorerView Class

WinExplorerView Members

DevExpress.XtraGrid.Views.WinExplorer Namespace