Scenario
In this example, it is demonstrated how to implement custom attributes in the application model to highlight focused layout items in DetailView:
The EnableHighlightFocusedLayoutItem attribute is implemented at the Application | Options node level and allows you to totally control this functionality.
The HighlightFocusedLayoutItem attribute is implemented at the Views | DetailView node level and allows you to customize only certain DetailViews. You can set both attributes via the Model Editor.
In Windows Forms applications, the functionality is provided with the help of the LayoutControl. In ASP.NET applications, the functionality is implemented manually via client-side events provided by our ASP.NET editors.
Steps to implement
1. Modify YourSolutionName.Module/Module.xx file as shown in the WinWebSolution.Module\Module.xx file of this example;
2. Copy the WinWebSolution.Module\HighlightFocusedLayoutItemDetailViewControllerBase.xx file into the YourSolutionName.Module project;
3. Copy the WinWebSolution.Module.Win\HighlightFocusedLayoutItemDetailViewController.xx file into the YourSolutionName.Module.Win project;
4. Copy the WinWebSolution.Module.Web\HighlightFocusedLayoutItemDetailViewController.xx file into the YourSolutionName.Module.Web project;
5. Copy the WinWebSolution.Web\E2106.js file into the YourSolutionName.Web project;
6. Add the <script type="text/javascript" src="E2106.js"></script> line into the <head> element of your YourSolutionName.Web\Default.aspx file.
IMPORTANT NOTES
It is possible to register your JavaScript functions at runtime via the DevExpress.ExpressApp.Web.WebWindow.CurrentRequestWindow.RegisterXXXScript methods called from a Controller when it is activated or when page controls are created. Refer to the How to automatically refresh data in a View after a certain period of time on the Web article for an illustration of this approach.
See Also:
Usability - highlight the focused editor in detail views
Question Comments
Added By: tzanis tasos at: 1/27/2015 11:52:22 AM
Hello,
In version V2014 14.2.4.0 this sample not work on web. It works only for combobox and not for other controls.
When i run the sample in debug mode, the existingHandler return empty string when eventName="GotFocus"
string existingHandler = control.GetClientSideEventHandler(eventName);