I add one customer user control into one cell, when the cell is activated, the customer user control should be displayed, when the cell is deactivated, the cell just display as text block.
The problem is when activated the cell, the customer user control is not displayed in the activated cell, must call gridControl. InvalidateCells().
I tried all InvalidateCell() methods, none works .
gridControl.InvalidateCell( CellSpanInfoBase span );
gridControl.InvalidateCell( GridRangeInfo gridRangeInfo );
gridControl.InvalidateCell( RowColumnIndex cellRowColumnIndex );
gridControl.InvalidateRenderCell( GridRangeInfo range );
gridControl.Model.InvalidateCell( CellSpanInfoBase span );
gridControl.Model.InvalidateCell( GridRangeInfo gridRangeInfo );
gridControl.Model.InvalidateCell( RowColumnIndex cellRowColumnIndex );
gridControl.Model.InvalidateVisual ()
gridControl. InvalidateCells() consume too much time. Is there any good method to resolve the problem?
Following is my source code:
CustomerUserControl customerUserControl = new CustomerUserControl ();
gridControl.Model[ rowIndex, columnIndex ].BeginUpdate();
Binding binding = new Binding();
binding.Source = customerUserControl;
FrameworkElementFactory customerUserControlFactory = new FrameworkElementFactory( typeof( customerUserControlTemplate ) );
customerUserControlFactory.SetBinding( CustomerUserControlTemplate.CustomerUserControlProperty, binding );
DataTemplate customerUserControlNewDataTemplate = new DataTemplate();
customerUserControlNewDataTemplate.DataType = typeof( CustomerUserControlTemplate );
customerUserControlNewDataTemplate.VisualTree = customerUserControlFactory;
customerUserControlNewDataTemplate.Seal();
gridControl.Model[ rowIndex, columnIndex ].CellEditTemplate = customerUserControlNewDataTemplate;
gridControl.Model[ rowIndex, columnIndex ].EndUpdate();
gridControl.InvalidateCells(); //Consume too much time