If you refresh an object set property of entity context, the RadGridView is not updated. The sample code below does not work: this.radGridView1.DataSource = entities.Countries; int maxId = (from c in entities.Countries orderby c.Id descending select c.Id).First(); Country country = new Country(); country.Id = maxId + 1; country.Name = Path.GetRandomFileName(); entities.Countries.AddObject(country); entities.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave); entities.Refresh(System.Data.Objects.RefreshMode.StoreWins, entities.Countries);
To reproduce: void radGridView1_CurrentRowChanged(object sender, Telerik.WinControls.UI.CurrentRowChangedEventArgs e) { e.CurrentRow.Cells[2].ColumnInfo.IsCurrent = true; }
- Create a new project containing RadGridView - Build hierarchy with large text data in cells - Set the AutoSizeRows property to true and AutoSizeColumnMode to Fill - Run the project, scroll down and try to click on a cell
To reproduce: void grid_RowValidating(object sender, RowValidatingEventArgs e) { e.Cancel = true; } Pressing the escape key should cancel the edit mode and revert the value
We should consider the Display attribute when using business objects as data source in RadGridView.
When you set a RadGridView's SelectionMode to GridViewSelectionMode.CellSelect and then you highlight full rows by using the row header, the SelectedRows collection is empty. Telerik support informed me this is "as expected" and that I should use "SelectedCells" collection when using the CellSelect Mode. While this is a decent workaround I don't see why SelectedRows collection can't be filled when the entire row is actually highlighted.
I have a GridView (Winforms v. 2017.3.1017.40, same problem with 2017.2.502.40) configured as on the attached screenshot (made some groups, made a search, and used the "excel-like" filter on a column to uncheck some values). Then I try to click on some column headers to sort the grid. After a few clicks, I get this error : InvalidOperationException: La collection a été modifiée ; l'opération d'énumération peut ne pas s'exécuter. I got different stacktrace with the same error : InvalidOperationException: La collection a été modifiée ; l'opération d'énumération peut ne pas s'exécuter. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at System.Collections.Generic.List`1.Enumerator.MoveNext() at Telerik.WinControls.UI.DataGroup.<GetEnumerator>d__0.MoveNext() at Telerik.WinControls.UI.GridViewGroupRowInfo.get_ChildRows() at Telerik.WinControls.UI.GridViewRowInfo.HasChildRows() at Telerik.WinControls.UI.PrintGridTraverser.CanStepInHierarchy() at Telerik.WinControls.UI.GridTraverser.StepInHierarchy() at Telerik.WinControls.UI.GridTraverser.MoveNextCore() at Telerik.WinControls.UI.GridTraverser.MoveNext() at Telerik.WinControls.UI.GridViewSearchRowInfo.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument) ----- InvalidOperationException: Failed to compare two elements in the array. ---> NullReferenceException: Object reference not set to an instance of an object. at Telerik.WinControls.UI.GridViewRowInfoComparer.CompareRows(GridViewRowInfo x, GridViewRowInfo y, SortDescriptorCollection context) at System.Collections.Generic.ArraySortHelper`1.InternalBinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer) at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer) --- End of inner exception stack trace --- at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer) at System.Collections.Generic.List`1.BinarySearch(Int32 index, Int32 count, T item, IComparer`1 comparer) at Telerik.Collections.Generic.HybridIndex`1.PerformWithQuickSort() at Telerik.Collections.Generic.HybridIndex`1.get_Items() at Telerik.Collections.Generic.Index`1.GetEnumerator() at Telerik.WinControls.Data.GroupBuilder`1.Perform(IReadOnlyCollection`1 items, Int32 level, Group`1 parent) at Telerik.WinControls.Data.GroupBuilder`1.get_Groups() at Telerik.WinControls.UI.GridViewInfo.Refresh() at Telerik.WinControls.UI.GridViewInfo.get_ChildRows() at Telerik.WinControls.UI.ViewInfoTraverser.SetCollectionForStage(Boolean initializeCollection) at Telerik.WinControls.UI.ViewInfoTraverser.ChangeCollectionForward() at Telerik.WinControls.UI.ViewInfoTraverser.MoveNextCore() at Telerik.WinControls.UI.ViewInfoTraverser.MoveNext() at Telerik.WinControls.UI.GridTraverser.MoveNextCore() at Telerik.WinControls.UI.GridTraverser.MoveNext() at Telerik.WinControls.UI.BaseGridNavigator.NavigateToRow(GridViewRowInfo row, Boolean select) at Telerik.WinControls.UI.BaseGridNavigator.ProcessViewChangedEvent(GridViewEvent eventData) at Telerik.WinControls.UI.BaseGridNavigator.ProcessEventCore(GridViewEvent eventData) at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode) at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent) at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent) at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents() at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent) at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI) at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(Object sender, DataViewChangedEventArgs args) at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e) at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e) at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify) at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e) at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName) at Telerik.WinControls.UI.GridViewSortDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at Telerik.WinControls.Data.SortDescriptor.set_Direction(ListSortDirection value) at Telerik.WinControls.UI.GridViewColumn.Sort(RadSortOrder sortOrder, Boolean multiSortMode) at Telerik.WinControls.UI.GridHeaderCellElement.Sort(RadSortOrder sortOrder) at Telerik.WinControls.UI.GridHeaderRowBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.UI.RadGridView.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at Telerik.WinControls.UI.RadGridView.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ------ InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at System.Collections.Generic.List`1.Enumerator.MoveNext() at Telerik.WinControls.UI.DataGroup.<GetEnumerator>d__0.MoveNext() [...] at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Alto.Client.Controls.Dispatch.DispatchResources.DeliveryPointFilterManager.get_DeliveryPointsVisible() in d:\Builds\45153\Alto\Alto.Prod\src\Alto\Alto.Client\Controls\Dispatch\DispatchResources\DeliveryPointFilterManager.cs:line 38 at Alto.Client.Controls.Dispatch.DispatchResources.UcDeliveryPoint.get_Title() in d:\Builds\45153\Alto\Alto.Prod\src\Alto\Alto.Client\Controls\Dispatch\DispatchResources\UcDeliveryPoint.cs:line 1520 at Alto.Client.Controls.Dispatch.DispatchResources.UcDeliveryPoint.updatePanelTitle() in d:\Builds\45153\Alto\Alto.Prod\src\Alto\Alto.Client\Controls\Dispatch\DispatchResources\UcDeliveryPoint.cs:line 543 at Alto.Client.Controls.Dispatch.DispatchResources.UcDeliveryPoint.onFilterChanged(Object sender, GridViewCollectionChangedEventArgs e) in d:\Builds\45153\Alto\Alto.Prod\src\Alto\Alto.Client\Controls\Dispatch\DispatchResources\UcDeliveryPoint.cs:line 547 at Telerik.WinControls.UI.GridViewCollectionChangedEventHandler.Invoke(Object sender, GridViewCollectionChangedEventArgs e) at Telerik.WinControls.UI.RadGridView.OnFilterChanged(Object sender, GridViewCollectionChangedEventArgs e) at Telerik.WinControls.UI.EventDispatcher.RaiseEvent[T](Object eventKey, Object sender, T args) at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at Telerik.Collections.Generic.NotifyCollection`1.InsertItem(Int32 index, T item) at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.InsertItem(Int32 index, FilterDescriptor item) at System.Collections.ObjectModel.Collection`1.Add(T item) at Telerik.WinControls.UI.GridViewDataColumn.SetFilterDescriptor(FilterDescriptor value) at Telerik.WinControls.UI.GridHeaderCellElement.filterPopup_FilterConfirmed(Object sender, EventArgs e) at Telerik.WinControls.UI.BaseFilterPopup.OnFilterConfirmed() at Telerik.WinControls.UI.RadListFilterPopup.OnButtonOkClick(EventArgs e) at Telerik.WinControls.UI.RadListFilterPopup.ButtonOK_Click(Object sender, EventArgs e) at Telerik.WinControls.RadElement.OnClick(EventArgs e) at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e) at Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e) at Telerik.WinControls.RadElement.DoClick(EventArgs e) at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e) at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at Telerik.WinControls.UI.RadPopupControlBase.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ---- InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at Telerik.WinControls.UI.DataGroup.<GetEnumerator>d__0.MoveNext() at Telerik.WinControls.Data.GroupBuilder`1.Perform(IReadOnlyCollection`1 items, Int32 level, Group`1 parent) at Telerik.WinControls.Data.DataItemGroup`1.get_Groups() at Telerik.WinControls.UI.DataGroup.get_Groups() at Telerik.WinControls.UI.GridViewTemplate.InvalidateSummaryRowsCore(DataGroup group, Boolean invalidateChildren) at Telerik.WinControls.UI.GridViewTemplate.InvalidateSummaryRowsCore(DataGroup group, Boolean invalidateChildren) at Telerik.WinControls.UI.GridViewTemplate.InvalidateGroupSummaryRows(DataGroup group, Boolean invalidateChildren) at Telerik.WinControls.UI.GridViewTemplate.RefreshSummaryRowsInGroup(NotifyCollectionChangedEventArgs e) at Telerik.WinControls.UI.GridViewTemplate.RefreshAggregates(NotifyCollectionChangedEventArgs e) at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e) at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify) at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e) at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName) at Telerik.WinControls.UI.GridViewSortDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at Telerik.WinControls.UI.GridViewSortDescriptorCollection.RemoveItem(Int32 index) at Telerik.WinControls.UI.GridViewColumn.Sort(RadSortOrder sortOrder, Boolean multiSortMode) at Telerik.WinControls.UI.GridHeaderCellElement.Sort(RadSortOrder sortOrder) at Telerik.WinControls.UI.GridHeaderRowBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.UI.RadGridView.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at Telerik.WinControls.UI.RadGridView.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Steps to reproduce: 1. Add a grid to a form and make it read only 2. Add a masked box column and set the mask 3. Add some data and run the project You will see that the mask is not applied to the values in the mask box column Comment: This is not an issue. The mask is applied after editing the text with RadMaskedEditBox, in read-only mode there is no masked editor created. You should use the conversion layer in RadGridView to solve the issue. Check the GridView >> Manipulated Data >> Convert Values example from our demo application.
To reproduce: please refer to the attached sample project. Workaround: this.radGridView1.TableElement.ScrollToRow(this.radGridView1.RowCount-1);
1. Create a new project with RadGridView. 2. Bind it and set grouping. 3. Add a summary row and set ShowParentGroupSummaries property to true. 4. Handle the ViewCellFormatting event and set all summary rows to be IsVisible = false when the processed cell is GridSummaryCellElement: void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridSummaryCellElement) { e.Row.IsVisible = false; } } CORRECT WAY TO HANDLE THIS CASE: Hide the summary rows in the groups you want after grouping/data binding. To hide the first bottom summary row of the first group in a RadGridView use the following code: this.radGridView1.Groups[0].GroupRow.BottomSummaryRows[0].IsVisible = false;
To reproduce: - add RadGridView and fill it with data; - use the following code for saving the layout: string layout; using (MemoryStream ms = new MemoryStream()) { radGridView1.SaveLayout(ms); ms.Position = 0; byte[] buffer = new byte[ms.Length - 1]; ms.Read(buffer, 0, buffer.Length); layout = Convert.ToBase64String(buffer); ms.Close(); } When you try to load the saved layout, using the following code, DataException is thrown: using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(layout))) { radGridView1.LoadLayout(stream); } Workaround: save the layout in xml file
Makes RadGridView to be thread safe by using from BackgroundWorker
Use attached to reproduce. This is not an issue. Performing Begin/End update disposes of all elements along with the globally declared item. You need to check if the item is disposed of: void ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e) { if (menuItem.IsDisposed) { menuItem = new RadMenuItem(); menuItem.Text = "Custom menu item"; menuItem.Click += menuItem_Click; } e.ContextMenu.Items.Add(menuItem); }
Steps to reproduce: 1. Add a GridViewDateTimeColumn to a grid. 2. Add rows where one or more rows should contain null as the columns value. 3. Sort the grid by the date time column. WORKAROUND: Create a custom RadGridDateTimeConverter and assign it as the column's date type converter: public class CustomRadGridDateTimeConverter : RadGridDateTimeConverter { public CustomRadGridDateTimeConverter(GridViewDateTimeColumn column) : base(column) { } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(DateTime) && value == null) { return DateTime.MinValue; } return base.ConvertTo(context, culture, value, destinationType); } } this.radGridView1.Columns["DateTime"].DataTypeConverter = new CustomRadGridDateTimeConverter(this.radGridView1.Columns["DateTime"] as GridViewDateTimeColumn);
To reproduce: protected override void OnLoad(EventArgs e) { this.radGridView1.AllowAddNewRow = false; this.radGridView1.TableElement.RowHeight = 40; this.radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewTextBoxColumn id = new GridViewTextBoxColumn("ID"); id.IsVisible = false; GridViewTextBoxColumn parentID = new GridViewTextBoxColumn("ParentID"); parentID.IsVisible = false; GridViewTextBoxColumn name = new GridViewTextBoxColumn("Name"); GridViewDateTimeColumn date = new GridViewDateTimeColumn("Date"); GridViewTextBoxColumn type = new GridViewTextBoxColumn("Type"); GridViewTextBoxColumn size = new GridViewTextBoxColumn("Size"); size.FormatString = "{0} MB"; radGridView1.Columns.AddRange(new GridViewDataColumn[] { id, parentID, name, date, type, size }); this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "ID", "ParentID"); radGridView1.CellValueChanged += radGridView1_CellValueChanged; fillData(); } void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e) { fillData(); } private void fillData() { radGridView1.Rows.Clear(); radGridView1.Rows.Add(1, null, "Program Files", DateTime.Now.AddDays(-100), "Folder", 5120); radGridView1.Rows.Add(2, 1, "Visual Studio 2010", DateTime.Now.AddDays(-100), "Folder", 3220); radGridView1.Rows.Add(3, 2, "bin", DateTime.Now.AddDays(-100), "Folder", 3220); radGridView1.Rows.Add(4, 2, "READEME.txt", DateTime.Now.AddDays(-100), "Text Document", 3); radGridView1.Rows.Add(100, null, "Test.txt", DateTime.Now.AddDays(-10), "Text File", 0); radGridView1.Rows.Add(5, 1, "Telerik RadControls", DateTime.Now.AddDays(-10), "Folder", 3120); radGridView1.Rows.Add(6, 5, "Telerik UI for Winforms", DateTime.Now.AddDays(-10), "Folder", 101); radGridView1.Rows.Add(7, 5, "Telerik UI for Silverlight", DateTime.Now.AddDays(-10), "Folder", 123); radGridView1.Rows.Add(8, 5, "Telerik UI for WPF", DateTime.Now.AddDays(-10), "Folder", 221); radGridView1.Rows.Add(9, 5, "Telerik UI for ASP.NET AJAX", DateTime.Now.AddDays(-10), "Folder", 121); radGridView1.Rows.Add(10, 1, "Microsoft Office 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(11, 10, "Microsoft Word 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(12, 10, "Microsoft Excel 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(13, 10, "Microsoft Powerpoint 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(14, 1, "Debug Diagnostic Tools v1.0", DateTime.Now.AddDays(-400), "Folder", 2120); radGridView1.Rows.Add(15, 1, "Designer's 3D Tools", DateTime.Now.AddDays(-500), "Folder", 1120); radGridView1.Rows.Add(16, 1, "Communication", DateTime.Now.AddDays(-700), "Folder", 120); } Then start the application edit a value and click another cell. Workaround: - Enclose the rows addition within Begin/End update block.
There should be a Enum (Left, Right, None) property of the Expander Column indicating whether the position of the expander column should be left right or none. This would be especially important during pinning activities meaning no matter how many columns are being pinned and repositioned in the pinned area of the grid, it would always remain on the left, right or none.
BindingList<Item> items = new BindingList<Item>(); public Form1() { InitializeComponent(); for (int i = 0; i < 20; i++) { items.Add(new Item(i % 4, "Item" + i, "Type" + i % 2)); } this.radGridView1.DataSource = items; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; } public class Item { public int Id { get; set; } public string Name { get; set; } public string Type { get; set; } public Item(int id, string name, string type) { this.Id = id; this.Name = name; this.Type = type; } } private void radButton1_Click(object sender, EventArgs e) { items.Insert(0, new Item(2, "Test", "Type0")); } WORKAROUND I: GridViewSynchronizationService.SuspendEvent(this.radGridView1.MasterTemplate, KnownEvents.CurrentChanged); Item item = new Item(2, "Test", "Type0"); items.Insert(0, item); GridViewSynchronizationService.ResumeEvent(this.radGridView1.MasterTemplate, KnownEvents.CurrentChanged); foreach (GridViewRowInfo row in this.radGridView1.Rows) { if (row.DataBoundItem == item) { this.radGridView1.CurrentRow = row; break; } } WORKAROUND II: this.radGridView1.Rows.CollectionChanged += Rows_CollectionChanged; this.radGridView1.GroupExpanding+=radGridView1_GroupExpanding; List<GridViewRowInfo> expandedGroups = new List<GridViewRowInfo>(); private void radGridView1_GroupExpanding(object sender, GroupExpandingEventArgs e) { if (!e.IsExpanded && shouldCollapse) { expandedGroups.Add(e.DataGroup.GroupRow); } } bool shouldCollapse = false; private void radButton1_Click(object sender, EventArgs e) { shouldCollapse = true; items.Insert(0, new Item(2, "Test", "Type0")); } private void Rows_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e) { if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add) { this.radGridView1.CurrentRow = e.NewItems[0] as GridViewRowInfo; this.radGridView1.CurrentRow.IsSelected = true; GridViewRowInfo parent = this.radGridView1.CurrentRow.Parent as GridViewRowInfo; if (parent != null) { parent.IsExpanded = true; } if (shouldCollapse) { shouldCollapse = false; foreach (GridViewRowInfo r in expandedGroups) { if (!ContainsParentRow(parent, r)) { r.IsExpanded = false; } } expandedGroups.Clear(); } } } private bool ContainsParentRow(GridViewRowInfo parent, GridViewRowInfo r) { GridViewGroupRowInfo group = r as GridViewGroupRowInfo; if (group != null) { foreach (GridViewRowInfo childRow in group.ChildRows) { return ContainsParentRow(parent, childRow); } } return parent == r.Parent; }
The conditional formatting collection get deleted after closing the property builder. To reproduce : Add a gridview with a datasource. Open property builder Select a column Advance -> ConditionalFormattingObjectList Add a expression, set a name Press Ok If you click the ConditionalFormattingObjectList, you can see the expression If you click close the Property Builder, the list is not saved when you open it again.