Current filter:
                                You should refresh the page.
                                Support Center
                                  • We're using a grid including the CommandColumn. How would we pre-select a row (from a model) when the view with the grid is revisited?

                                    Many Thanks!

                                1 Solution

                                Creation Date Rating Importance Sort by

                                Hello Irfaan,

                                Thank you for contacting us. I suggest that you implement the following scenario to accomplish this task:
                                1) Use the GridViewSettings.PreRender property, to get access to the internal ASPxGridView object and its Selection state;
                                2) Iterate through the DataRows (from "0" to VisibleRowCount) and select the required DataRow based on the Model data via the Selection.SetSelection method.

                                Below the code snippet, illustrating how to accomplish this task by using the Grid View - Filter Row Online Demo:


                                //... settings.KeyFieldName = "ProductID"; //... settings.PreRender = (sender, e) => { ASPxGridView gridView = (ASPxGridView)sender; for (int i = 0; i < gridView.VisibleRowCount; i++) { gridView.Selection.SetSelection(i, (bool)gridView.GetRowValues(i, "Discontinued")); } };

                                See Also:
                                E20039 - GridView - How to Select a Particular Rows when a Page is Opened First Time


                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners