How to Highlight Locked Files and Display Tooltip for these Files.
Environment
Product Version | Product | Author |
---|---|---|
2022.2.511 | File Dialogs for WinForms | Dinko Krastev |
Description
A common requirement in File Dialogs is to highlight a file that has been locked by another process. In the next section we will demonstrate how we can do that.
Solution
To highlight a file that has been locked by another process, we can subscribe to the Shown() event of the file dialogs. For the purpose of this example we are going to use RadOpenFileDialog and set the ViewType of the ExplorerControl to DeailtsView. Then we can subscribe to the VisualItemFormatting event of the RadListView part. Inside the event handler we can check if a file is locked by trying to open it. Here we can change the BackColor of the VisualItem if we can't open it.