Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • i bound my grid to a EntitySet "i.e. EntityCollection<DesignElements>".
                                    i need access to entity that in grid's row displayed by EditGridCellData (cause i need use it in CellTemplateSelector).
                                    i found following:
                                       public class PropertyValueTemplateSelector : DataTemplateSelector
                                        {
                                            public override DataTemplate SelectTemplate(object item, DependencyObject container)
                                            {
                                                EditGridCellData cellData = item as EditGridCellData;
                                                GridControl grid = (cellData.Column.Parent as GridControl);
                                                DevExpress.Xpf.Data.RowHandle rowHandle = (cellData.Data as DevExpress.Xpf.Data.RowTypeDescriptor).RowHandle;
                                                var rowElement = grid.View.GetRowElementByRowHandle(rowHandle.Value);
                                                DevExpress.Xpf.Grid.GridRow gridRow = rowElement as DevExpress.Xpf.Grid.GridRow;
                                                DevExpress.Xpf.Grid.RowData rowData = gridRow.DataContext as DevExpress.Xpf.Grid.RowData;
                                                DesignElement DE = ?????????? as DesignElement;
                                          }
                                    }
                                    what ust i put in ?????? in
                                    DesignElement DE = ?????????? as DesignElement;

                                0

                                Hi,

                                Once you obtain row handle, you can use the grid's GetRow method to access the underlying data object. Please modify the code as follows:

                                [C#]
                                public class PropertyValueTemplateSelector : DataTemplateSelector { public override DataTemplate SelectTemplate(object item, DependencyObject container) { EditGridCellData cellData = item as EditGridCellData; GridControl grid = (cellData.Column.Parent as GridControl); DevExpress.Xpf.Data.RowHandle rowHandle = (cellData.Data as DevExpress.Xpf.Data.RowTypeDescriptor).RowHandle; DesignElement DE = grid.GetRow(rowHandle.Value) as DesignElement; } }

                                Thanks,
                                Vito

                                0

                                thanks. work like a charm

                                0

                                Solved

                                0

                                You are welcome!

                                Thanks,
                                Vito

                                If you need additional product information, write to us at info@devexpress.com 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, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

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