Current filter:
                                You should refresh the page.

                                  • Starting from version 14.1, the GridControl introduces optimized mode. It is enabled by default and provides a greatly improved scrolling performance and a reduced load time for hot starts after loading the first instance.

                                    In-place Editing

                                    In optimized mode GridControl uses the new DevExpress.Xpf.Editors.InplaceBaseEdit editor to display cells content. It is used for different column types - Text, ComboBox and even CheckBox columns. This is a special lightweight editor that does not have a default visual tree.

                                    Setting in-place editors with the DataViewBase.CellTemplate property generates unoptimized editors. To use optimized editors, place a DevExpress.Xpf.Editors.InplaceBaseEdit editor with the Name property set to “PART_Editor” inside the cell template. With this approach, the editor settings are taken from the ColumnBase.EditSettings property of the GridColumn.

                                    Since implicit editor styles do not work in optimized mode, either use a style for DevExpress.Xpf.Editors.InplaceBaseEdit or create the required editor using the DataViewBase.CellTemplate. To set a custom style for the editor in edit mode, use the EditCoreStyle property of DevExpress.Xpf.Editors.InplaceBaseEdit.

                                     

                                    The following editors support the optimized mode.

                                    ButtonEdit

                                    Calculator
                                    CheckEdit
                                    ComboBoxEdit
                                    DateEdit
                                    LookUpEdit
                                    PopupBaseEdit
                                    SpinEdit
                                    TextEdit

                                    Row and Cell Resources

                                    When the GridControl is in optimized mode, it uses special lightweight visual elements and templates. Thus, custom styles or resources that were working in previous versions may not work in 14.1 by default. To provide compatibility with older versions, set the TableView.UseLightweightTemplates property to None to enable the previous version of the visual tree.

                                    To migrate an application created in version 13.2 or older, rewrite the overridden resources for new visual elements. In the attachment, there is a table with the corresponding elements of both modes. You can find the same table by the following link: Optimized Mode Styles and Templates.


                                    The following public styles require another target type in optimized mode.

                                    For TableView.RowStyle, the target type is DevExpress.Xpf.Grid.RowControl.

                                    For DataViewBase.CellStyle, the target type is DevExpress.Xpf.Grid.LightweightCellEditor.


                                    The base style is as follows:

                                    [XAML]
                                    xmlns:dxgt="<a href="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" <Style BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}" TargetType="{x:Type dxg:LightweightCellEditor}"> ...

                                     

                                    TableView.DefaultDataRowTemplate and TableView.RowDecorationTemplate are not supported in optimized mode.
                                    RowDetailsTemplate and RowDetailsTemplateSelector are only supported in grid's optimized mode.

                                    See also: 

                                    Optimized Mode
                                    Optimized Mode Styles and Templates
                                    T152867 - How to use CellStyle in different themes

                                Show all comments
                                • Johannes Kiemer 05.23.2014

                                  Can {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle} also be used as base style for a public style that is used as TableView.RowStyle?

                                • Michael Ch (DevExpress Support) 05.23.2014

                                  Hello,

                                  As far as I understand, by "used as TableView.RowStyle" you mean the TableView's CellStyle property. If so, you can use "{dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}" as a base style.

                                • Larry Dude 05.25.2014

                                  I believe what he meant is exactly what he wrote: The RowStyle property.

                                  Old:
                                  <Style BasedOn="{StaticResource {themes:GridRowThemeKey ResourceKey=RowStyle}}" TargetType="{x:Type dxg:GridRowContent}">

                                  New ones doesn't work:
                                  <Style BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}" TargetType="{x:Type dxg:RowControl}">

                                  because:
                                  System.InvalidOperationException: Can only base on a Style with target type that is base type 'RowControl'.

                                • Johannes Kiemer 05.26.2014

                                  Thank you Yari for clarifying what I meant!

                                • Michael Ch (DevExpress Support) 05.26.2014

                                  Thank you for the clarification. The RowStyle and CellStyle are different and provide the capability to style different elements of the GridControl.
                                  To style a GridControl row, you can use the following resources:

                                  [XAML]
                                  <Style x:Key="unoptimizedRowStyle" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}" TargetType="{x:Type dxg:GridRowContent}"> ... </Style>  <Style x:Key="optimizedRowStyle" TargetType="{x:Type dxg:RowControl}"> ... </Style>

                                  To style a GridControl cell:

                                  [XAML]
                                  <Style x:Key="unoptimizedCellStyle" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=CellStyle}}" TargetType="{x:Type dxg:CellContentPresenter}"> ... </Style> <Style x:Key="optimizedCellStyle" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}" TargetType="{x:Type dxg:LightweightCellEditor}"> ... </Style>

                                   Let me know if you have any additional questions.

                                • Johannes Kiemer 05.26.2014

                                  The style in your example isn't based on a style:

                                  <Style x:Key="optimizedRowStyle" TargetType="{x:Type dxg:RowControl}">
                                  ...
                                  </Style>

                                  Isn't there an optimized mode equivalent for BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}"?

                                • Michael Ch (DevExpress Support) 05.27.2014
                                  Hello,

                                  There's no need to base your own custom RowStyle style on the default RowStyle, since these styles are applied consistently. This is due to the fact that GridControl (in 14.1)  uses standard approaches for row styling and templating. In CellStyle, we use a different approach, which requires specifying the base style. Thus, for cells customization, it's necessary to specify a base style unlike for GridControl rows.

                                  Thanks,
                                  Michael
                                • Johannes Kiemer 05.27.2014

                                  Thank you very much for your explanation!

                                • Robin Marsh 05.27.2014

                                  Hi,
                                  We have just upgraded our system to this version and all our grids are now erroring.  This would be easier if you could provider  a sample grid with an inline editor, maybe a spin edit.

                                  Regards
                                  Robin Marsh

                                • Ilya (DevExpress Support) 05.27.2014

                                  Hi Robin,
                                  In order to prevent multiple discussions in this ticket, I extracted your question in a separate thread. Please refer to T110944 for more information.

                                • Larry Dude 05.27.2014

                                  When applying a style to a row in the way mentioned above, there's no visual feedback on focused rows anymore like there is with the default row style, is that correct? If so, how can I add this visualization again?

                                • Alexander S (DevExpress Support) 05.28.2014
                                   Hi Yari,
                                  On my side the following style works as expected:
                                  [XAML]
                                  <dxg:TableView.RowStyle> <Style TargetType="{x:Type dxg:RowControl}"> <Style.Triggers> <DataTrigger Binding="{Binding IsFocused}" Value="True"> <Setter Property="Background" Value="#20FF0000" /> </DataTrigger> <DataTrigger Binding="{Binding IsSelected}" Value="True"> <Setter Property="Background" Value="Red" /> </DataTrigger> </Style.Triggers> </Style> </dxg:TableView.RowStyle>
                                    Would you please provide us with your custom row style?
                                • Larry Dude 05.28.2014

                                  Hello,

                                  That's my current row style that worked previous 14.1 (as well as the focused row style got applied kinda automatically):

                                                                                <dxg:TableView.RowStyle>
                                                                                    <Style TargetType="{x:Type dxg:RowControl}">
                                                                                        <Style.Triggers>
                                                                                            <DataTrigger Binding="{Binding Path=DataContext.IsOwn}" Value="True">
                                                                                                <Setter Property="Background" Value="Red" />
                                                                                            </DataTrigger>
                                                                                        </Style.Triggers>
                                                                                    </Style>
                                                                                </dxg:TableView.RowStyle>

                                  That's not the case with 14.1 now.

                                • Ivan (DevExpress Support) 05.29.2014
                                  Hi all,
                                  In order not to discuss multiple questions in this ticket, let's continue our discussion in the How to set RowStyle in version 14.1 thread. I have exported Yari's comment to this thread and will post an answer there.
                                • Johannes Kiemer 05.30.2014

                                  My problems could be fixed with the suggestions in the thread in Ivan's last comment. Thank you.

                                • Chris Sulmone 06.03.2014

                                  Do we still get the benefit of the optimized editors when using a custom DataTemplate for the CellTemplate of each column?

                                • Cyber Sinh 06.03.2014

                                  Hi,

                                  I'm not sure to understand how to correctly migrate my cell DataTemplate to use the grid in optimized mode. You will find attached a XAML file containing several of my cell DataTemplate. Could you take a look at them and tell me what I have to change to use the new optimized grid ?

                                  Thanks

                                • Quentin Suckling 06.03.2014

                                  So if I previously had a style for the inplace combo box edit such as below, how do I apply that style to the ComboBoxEditSettings now?
                                  I tried to set the EditCoreStyle but it doesn't exist on ComboBoxEditSettings.
                                  I obviously can't just create a style for InplaceBaseEdit because it doesn't have the combo box properties.

                                  <dxg:GridColumn.EditSettings>
                                  <dxe:ComboBoxEditSettings DisplayMember="ActionCategoryName"
                                   ItemsSource="{Binding Path=LookupActionCategories}"
                                   Style="{StaticResource SelectComboBoxEditSettingsStyle}" />
                                  </dxg:GridColumn.EditSettings>

                                     <Style x:Key="SelectComboBoxEditSettingsStyle" TargetType="dxe:ComboBoxEditSettings">
                                         <Setter Property="IsTextEditable" Value="True" />
                                         <Setter Property="AutoComplete" Value="True" />
                                         <Setter Property="ImmediatePopup" Value="False" />
                                         <Setter Property="ValidateOnEnterKeyPressed" Value="True" />
                                         <Setter Property="ValidateOnTextInput" Value="True" />
                                         <Setter Property="IncrementalFiltering" Value="True" />
                                     </Style>

                                • Quentin Suckling 06.03.2014

                                  I've created a separate question for this -
                                  https://www.devexpress.com/Support/Center/Question/Details/T114037

                                • Elliot (DevExpress Support) 06.04.2014
                                  Thank you for your reply. We will process that ticket shortly. Your patience is very appreciated.
                                • Thomas R Melinsky 06.04.2014

                                  Is there a way to disable optimized mode?

                                • Alex Chuev (DevExpress) 06.04.2014
                                  Hi Thomas,

                                  Yes, you can disable optimized mode by setting the TableView.UseLightweightTemplates property to 'None'.

                                  Thanks,
                                  Alex
                                • Tony Palumbo 06.05.2014

                                  Hi guys,

                                  I have a project that I updated from 13.2.9 to 14.1 and I get the same error.  The code seems to be stopping here:

                                  <dxg:GridControl.View>
                                                                         <dxg:TableView AutoWidth="True" FilterEditorCreated="OnTableViewFilterEditorCreated"
                                                                                    ShowDetailButtons="False" AutoScrollOnSorting="False" RowDoubleClick="TableView_RowDoubleClick" Style="{DynamicResource GridTableStyle}" AlternateRowBackground="{x:Null}" >

                                                                             <dxg:TableView.RowCellMenuCustomizations>

                                                                                 <dxb:BarCheckItem Content="Highlight Car" Glyph="Images/PopupMenu/Highlighted.png"
                                                                                             IsChecked="{Binding Path=(dxg:GridPopupMenu.GridMenuInfo).Row.Row.Highlight, RelativeSource={RelativeSource Self}}" />

                                                                                 <dxb:BarEditItem Content="Highlight Color"  EditWidth="200" Glyph="Images/PopupMenu/color.png"
                                                                                             EditValue="{Binding Path=(dxg:GridPopupMenu.GridMenuInfo).Row.Row.HighlightColor, RelativeSource={RelativeSource Self}}" >

                                                                                     <dxb:BarEditItem.EditSettings>
                                                                                         <dxe:PopupColorEditSettings DefaultColor="#FFF9EE02" IsSharedPopupSize="False" ShowMoreColorsButton="False" ShowNoColorButton="True" ShowDefaultColorButton="False" />
                                                                                     </dxb:BarEditItem.EditSettings>
                                                                                     
                                                                                 </dxb:BarEditItem>

                                                                                 <dxb:BarItemSeparator/>
                                                                                 <dxb:BarCheckItem Content="Our Car" Glyph="Images/PopupMenu/OurCar.png"
                                                                                               IsChecked="{Binding Path=(dxg:GridPopupMenu.GridMenuInfo).Row.Row.OurCar, RelativeSource={RelativeSource Self}}" />
                                                                                 <dxb:BarCheckItem Content="Hide Competitor" Glyph="Images/PopupMenu/View.png"
                                                                                               IsChecked="{Binding Path=(dxg:GridPopupMenu.GridMenuInfo).Row.Row.Visible, RelativeSource={RelativeSource Self}}" />
                                                                                 <dxb:BarCheckItem Content="Show Sparkline" Glyph="Images/sparkline.png"
                                                                                               IsChecked="{Binding Path=(dxg:GridPopupMenu.GridMenuInfo).Row.Row.SparklineVisibility, RelativeSource={RelativeSource Self}}" />

                                                                             </dxg:TableView.RowCellMenuCustomizations>

                                                                         </dxg:TableView>
                                                                     </dxg:GridControl.View>

                                  What SPECIFICALLY do I need to change?  It is just not exactly clear in the above.

                                  This is the error:
                                  'Initialization of 'DevExpress.Xpf.Grid.TableView' threw an exception.' Line number '751' and line position '63'.

                                  Thanks much.

                                • Elliot (DevExpress Support) 06.05.2014
                                  Your issue will be processed in the DXGrid's Optimized Mode ticket.
                                • Semyon Dvoynishnikov 06.06.2014

                                  How can I disable "Optimized mode"? UseLightweightTemplates doesn't work at all.

                                  I wrote:
                                  <DataTemplate x:Key="RowWithBottomLineTemplate">
                                    <StackPanel Orientation="Vertical">
                                        <dx:MeasurePixelSnapper>
                                            <ContentPresenter x:Name="defaultRowPresenter" Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}" />
                                        </dx:MeasurePixelSnapper>
                                        <Line Stretch="Fill" Stroke="LightGray" X2="1" />
                                    </StackPanel>
                                  </DataTemplate>
                                  ...

                                  <dxg:GridControl.View>
                                    <dxg:TableView UseLightweightTemplates="None" AutoWidth="True" AllowEditing="False" AllowGrouping="False" ShowGroupPanel="False" ShowColumnHeaders="False" ShowBandsPanel="False" ShowIndicator="False" NavigationStyle="Row" ShowHorizontalLines="False" ShowVerticalLines="False" DataRowTemplate="{StaticResource RowWithBottomLineTemplate}"/>
                                  </dxg:GridControl.View>

                                  After lauch I got XamlParseException with InvalidOperationException ({"The CellStyle target type is not supported in the grid's optimized mode. Either disable the optimized mode or change the target type to LightweightCellEditor. To learn more about the grid's optimized mode, see http://go.devexpress.com/xpf-optimized-mode.aspx";;}) as InnerException.

                                  Why have I Optimized Mode still?

                                • Semyon Dvoynishnikov 06.06.2014

                                  Additional. I use these cell styles:

                                     <Style x:Key="MainInformationCellStyle"
                                            BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=CellStyle}}"
                                            TargetType="{x:Type dxg:GridCellContentPresenter}">
                                         <Setter Property="FontFamily" Value="Segoe UI" />
                                         <Setter Property="FontSize" Value="14" />
                                     </Style>
                                     <Style x:Key="AdditionalInformationCellStyle"
                                            BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=CellStyle}}"
                                            TargetType="{x:Type dxg:GridCellContentPresenter}">
                                         <Setter Property="FontFamily" Value="Segoe UI" />
                                         <Setter Property="FontSize" Value="11" />
                                     </Style>

                                • Alex Chuev (DevExpress) 06.06.2014
                                  Hi Semyon,

                                  To keep this thread clean and readable, let's discuss this issue in a separate ticket: T115761 - The grid still uses Optimized Mode when the UseLightweightTemplates property is set to 'None'.

                                  Thanks,
                                  Alex
                                • Andreas Isbarn 07.04.2014

                                  What is the base style for TableView.RowStyle with target type DevExpress.Xpf.Grid.RowControl?

                                  It is not mentioned above and unfortunately I was not able to figure it out by myself.

                                • Elliot (DevExpress Support) 07.06.2014

                                  In 14.1, if you wish to apply a custom style to a row, there is no need to specify BasedOn, because the default style and your custom one will be applied consistently. We have already discussed a similar issue at GridControl throws the "System.InvalidOperationException: Can only base on a Style with target type that is base type 'RowControl'." exception. Please take a moment to review this ticket for additional information.

                                • Elliott Mehrbach 07.17.2014

                                  So, unless I want to go through all of my existing code and read all of this documentation to fix all of the issues that have been caused by upgrading to version 14 I need to revert to version 13. Now I need two pc's one for new code that is written using version 14 and one for the older code that version 14 has broken. I do not have the time to make the changes because your components are not backward compatible.. Wow! I use to think DevExpress was good.

                                • Ivan (DevExpress Support) 07.18.2014

                                  Hi Elliott,
                                  I have described the situation in the T117640 thread. Please refer to it for more information.
                                  As it's not always possible to avoid breaking changes when improving products, I suggest you review the list of breaking changes (we publish such lists for each version). This will help you avoid possible issues when updating your application. You can find the required list here.

                                • kiru 07.18.2014

                                  Hi Ivan
                                   I upgraded to 14.1 but cannot find LightWeightCellEditor in the xaml. When I type DevExpress.Xpf.Grid.LightWeightCellEditor in the code behind it is recognized. What is the namespace we have to use in xaml file. I coudn't find this any where in your documentations.

                                  What is the replacement for below style. Getting errors

                                  <Style x:Key="RowStyle" TargetType="{x:Type ContentControl}">
                                                 <Setter Property="Background"
                                                     Value="{Binding Path=DataContext.AnimationElement.Color, Converter={local:ColorToBrushConverter}}"/>
                                                 <Style.Triggers>
                                                     <Trigger Property="dxg:GridViewBase.IsFocusedRow" Value="true">
                                                         <Setter Property="Background" Value="#CFEAFC">
                                                         </Setter>
                                                     </Trigger>
                                                 </Style.Triggers>
                                             </Style>

                                • Michael Ch (DevExpress Support) 07.20.2014

                                  Hello,

                                  To process your recent post more efficiently, we copied it to a separate ticket created on your behalf: T131492: How to define LightWeightCellEditor in xaml.
                                  This ticket is currently in our processing queue. We will post to it as soon as we have any updates.

                                0 Solutions

                                Creation Date Importance Sort by