C#. net core 6, winforms application, TekerikNuGet3 package source, UI.for.WinForms.AllControls.NetCore package 2022.2.622
I am trying to export selected cells from a RadGridView as a csv file.
When using "var exporter = new ExportToCSV(Dgv)" then "exporter.RunExport(fileName);" writes the csv file correctly. It exports every cell.
It doesn't support exporting selections so I wrote a function to do this . The one below is what I used in my project to test what I was doing. It initially writes the csv to a worksheet and wrote that using formatprovider to file, then I just created a stringbuilder adding quotes and appended that to the file afterwards.
Writing the worksheet, the csv values haven't been quoted, plus number fields have had leading zeros removed which proves to be a problem when telephone numbers are stored in a field.
So I googled and found the Settings property which is there to set csv options. But they are private, not public therefore I can't set up the csv propertly.
private void radButton1_Click(object sender, EventArgs e)
{
var workbook = new Workbook();
var worksheet = workbook.Worksheets.Add();
var rowIndex = 0;
var columnIndex = -1;
var sb = new StringBuilder();
var prevColumnIndex = -1;
// ForEach cell are accessed vertically then horizontally.
foreach (var cell in Dgv.SelectedCells)
{
// Cell is included in selection even if it's invisible
// so check visibility and ignore if it isnt
if (!cell.ColumnInfo.IsVisible) continue;
// At bottom of column, rownum will change. Watch for this
// and reset x and y values
var rowNum = cell.RowInfo.Index;
if (rowNum != prevColumnIndex)
{
prevColumnIndex = rowNum;
rowIndex = 0;
columnIndex++;
sb.AppendLine("");
}
else if (!string.IsNullOrEmpty(sb.ToString()))
sb.Append(",");
var value = cell.Value;
worksheet.Cells[columnIndex, rowIndex++ ].SetValue(value.ToString());
sb.Append($"\"{value.ToString()}\"");
}
var fileName = @"C:\temp\SampleFile.csv";
IWorkbookFormatProvider formatProvider = new CsvFormatProvider();
using var output = new FileStream(fileName, FileMode.Create);
formatProvider.Export(workbook, output);
output.Close();
// Write contents of sb to the file for comparison sake
File.AppendAllText(fileName, sb.ToString());
}
i am getting a null reference exception with the following call stack:
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at Telerik.WinControls.UI.TableViewRowLayoutBase.GetRowHeight(Telerik.WinControls.UI.GridViewRowInfo)
at Telerik.WinControls.UI.RowElementProvider.GetElementSize(Telerik.WinControls.UI.GridViewRowInfo)
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetScrollHeight(System.__Canon)
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ScrollDown(Int32)
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ScrollTo(Int32)
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].scrollbar_ValueChanged(System.Object, System.EventArgs)
at Telerik.WinControls.UI.RadScrollBarElement.OnValueChanged(Int32, Int32)
at Telerik.WinControls.UI.RadScrollBarElement.set_Value(Int32)
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].UpdateScrollValue()
at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].UpdateScrollRange()
at Telerik.WinControls.UI.RowScroller.UpdateScrollRange()
at Telerik.WinControls.UI.GridTableElement.UpdateNoDataText()
at Telerik.WinControls.UI.GridTableElement.UpdateAll()
at Telerik.WinControls.UI.GridTableElement.UpdateViewCore(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.GridTableElement.UpdateView(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(Telerik.WinControls.UI.GridViewEvent)
at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(Telerik.WinControls.UI.GridViewEvent)
at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(Telerik.WinControls.UI.GridViewEvent, Telerik.WinControls.UI.PriorityWeakReferenceList, Telerik.WinControls.UI.GridEventProcessMode)
at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(Telerik.WinControls.UI.GridViewEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(Telerik.WinControls.UI.GridViewEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(Telerik.WinControls.UI.GridViewEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(Telerik.WinControls.UI.GridViewTemplate, Telerik.WinControls.UI.GridViewEvent, Boolean)
at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(Telerik.WinControls.UI.GridViewEvent, Boolean)
at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.GridViewTemplate.EndUpdate(Boolean, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.MasterGridViewTemplate.EndUpdate(Boolean, Telerik.WinControls.UI.DataViewChangedEventArgs)
at Telerik.WinControls.UI.GridViewTemplate.set_RowCount(Int32)
at Telerik.WinControls.UI.RadGridView.set_RowCount(Int32)
at Communication_Logger.frmCommunicationLogger.RadRibbonForm1_OnDataReceived(Communication_Logger.Data)
at Communication_Logger.ChannelClass.Serial_DataReceived(System.Object, System.IO.Ports.SerialDataReceivedEventArgs)
at System.IO.Ports.SerialPort.CatchReceivedEvents(System.Object, System.IO.Ports.SerialDataReceivedEventArgs)
at System.IO.Ports.SerialStream+EventLoopRunner.CallReceiveEvents(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
the setup is a dotNet 4.5.2 winforms application with RadGridView in virtual mode.
The exception occur when the application is left working for days (2 in this case) without any user interaction.
The application normally updates a list that is used by the gridview, the list records are added and removed continuously, the grid view RowCount is updated via a timer.
i suspect that the RowCount reported at one point in time doesn't match the list size as it is trimmed, and therfore the GetRowHeight fails as the data doesn't exist - can this be handled in the gridview - to avoid a termination of the process due to the exception ?
regards,
guy.
Eery time I use the GridView, I have to remember to un-select the last item in the list.
This is almost always to wrong thing to be selected - so why select it by default?
..and the way to swith this 'feaure' off isn't obvious - I always have to look it up....RadGridView1.CurrentRow = Nothing
Hi. it was great to see the option "ImageOnly", for columns of small width, where only the image is placed in the header, and the "HederText" property was set, for the correct display of the grouping field
GridViewDataColumn column;
column.HeaderText = "Счет";
column.HeaderImage = ...; // some img
column.TextImageRelation = TextImageRelation.Overlay;
GridViewDataColumn column;
column.HeaderText = "";
column.HeaderImage = ...; // some img
column.TextImageRelation = TextImageRelation.Overlay;
it’s impossible to choose one thing, either an ugly header, or a grouping without a description
To reproduce:
public RadForm1()
{
InitializeComponent();
string txt = "what follows is test characters (some of) which should cause error: เปลี่ยน UPS ที่ห้อง Truck scale เนื่องจากเมื่อวันพฤหัสที่ 13 มีการออฟเบรกเกอร์ที่ ฺฺB/H แต่ว่า เครื่องคอมพิวเตอร์ที่ T/S ดับ ตัว UPS ไม่ทำงาน ทำให้ข้อมูลขณะนั้นหายไป ";
this.label1.Text = txt; // No error
Font font = this.label1.Font;// new Font("Segoe UI", 9.5f, FontStyle.Regular);
this.radLabel1.Font = font;
this.radLabel1.Text = txt; //GDI error
}
Workaround:
this.radLabel1.UseCompatibleTextRendering = false;
Hi,
I have a question regarding RadGridView. When I edit a cell in GridView and then click on a button (outside of gridview) immediately (i.e I don't click on another cell to exit edit mode), the Gridview is still edit mode. Please refer to the short video named "Without Using EndEdit()" to easily understand my point here.
In order to exit the edit mode, I try the following code:
Private Sub CustomGridView_LostFocus(sender As Object, e As EventArgs) Handles Me.LostFocus Me.EndEdit() End Sub
With this code, the gridview does exit the edit mode when I click on another button. But there is a problem with this method is that afterwards, I cannot edit the cell anymore. Please refer to the short video named "Using EndEdit()" to better understand the problem.
So my question here is, is there any way that I can exit edit mode when clicking on another button right after editing a cell?
Thank you for your help.
Best regards,
Tran
To reproduce: please open the attached sample project and follow the steps illustrated in the attached gif file. Workaround: 1. You still can scroll while dragging a row by using the mouse wheel. 2. Use the grid in unbound mode and set the AllowRowReorder property to true instead of using a custom RadDragDropService. 3. Use a custom drag and drop service: public class CustomDragDropService : RadGridViewDragDropService { public CustomDragDropService(RadGridViewElement gridViewElement) : base(gridViewElement) { } public override string Name { get { return typeof(RadGridViewDragDropService).Name; } } protected override void HandleMouseMove(System.Drawing.Point mousePosition) { base.HandleMouseMove(mousePosition); System.Drawing.Point location = this.GridViewElement.ElementTree.Control.PointToClient(Control.MousePosition); GridTableElement tableElement = this.GetTableElementAtPoint(location); ISupportDrag supportDrag = this.Context as ISupportDrag; object dataContext = supportDrag.GetDataContext(); if (this.AllowAutoScrollRowsWhileDragging && dataContext == null) { ScrollRows(tableElement, location); } } private void ScrollRows(GridTableElement tableElement, System.Drawing.Point location) { ScrollableRowsContainerElement scrollableRows = tableElement.ViewElement.ScrollableRows; RadScrollBarElement vScrollbar = GetVeritcalScrollbar(tableElement); System.Drawing.Rectangle containerBounds = scrollableRows.ControlBoundingRectangle; if (containerBounds.Contains(location) || location.X < containerBounds.X || location.X > containerBounds.Right) { return; } int delta = 0; if (location.Y > containerBounds.Bottom) { delta = location.Y - containerBounds.Bottom; } else if (location.Y < containerBounds.Y) { delta = location.Y - containerBounds.Y; } if (delta != 0 && vScrollbar.Visibility == ElementVisibility.Visible) { vScrollbar.Value = ClampValue(vScrollbar.Value + delta, vScrollbar.Minimum, vScrollbar.Maximum - vScrollbar.LargeChange + 1); } } private int ClampValue(int value, int minimum, int maximum) { if (value < minimum) { return minimum; } if (maximum > 0 && value > maximum) { return maximum; } return value; } private RadScrollBarElement GetVeritcalScrollbar(GridTableElement tableElement) { if (GridViewElement.UseScrollbarsInHierarchy) { return tableElement.VScrollBar; } return GridViewElement.TableElement.VScrollBar; } } public RadForm1() { InitializeComponent(); CustomDragDropService customService = new CustomDragDropService(radGridView1.GridViewElement); radGridView1.GridViewElement.RegisterService(customService); }
When the "x" is used it seems that AllowSearchRow is not set to false because the toggle button has then to be pressed twice to show up the search mask again.
Hi,
I want to extend the RadGridView control, so I do "public class TkGrid : Telerik.WinControls.UI.RadGridView {}"
How do I apply a theme to TkGrid control ? I set "ThemeResolutionService.ApplicationThemeName = "FluentDark" but this doesn't work.
I attached a small project where I have one TkGrid and one RadGridView. On top of form there is a dropdown from where you can change the theme
When I do this, TkGrid is not displayed with the new theme (this works for RadGridView)
p.s. I also added a custom Button, TkButton inherited from RadButton. When I change the theme, the look of TkButton is changed, so this is ok
Hi,
I want to add a MultiComboBoxColumn to a GridView
is it possible to define the columns for this MultiComboBox at design time (in Property Builder editor of Grid) ?
Please refer to the attached sample project and the follow the steps in the gif file.
Workaround: scroll to the top and then to the bottom again to update the scrollbar's range
Using a custom control using the Telerik Presentation Framework, I am receiving a NullException inside the GridCheckBoxHeaderCellElement during the GridViewElement's data load.
The custom control construction follows an example I found somewhere (reference is lost to me at this point):
ControlContainingGridView inherits from RadControl
CreateChildItems creates and adds ControlContainingGridViewElement
ControlContainingGridViewElement inherits from RadElement
CreateChildItems creates and adds some layout controls AND a GridViewElement
public partial class ControlContainingGridView : RadControl {
public ControlContainingGridView() {
InitializeComponent();
this.TextChanged += ControlContainingGridView_TextChanged;
}
private void ControlContainingGridView_TextChanged(object sender, EventArgs e) {
controlContainingGridViewElement.Text = this.Text;
}
private ControlContainingGridViewElement controlContainingGridViewElement = null;
protected override void CreateChildItems(RadElement parent) {
controlContainingGridViewElement = new ControlContainingGridViewElement();
this.RootElement.Children.Add(controlContainingGridViewElement);
base.CreateChildItems(parent);
}
public object DataSource {
get {
return controlContainingGridViewElement.GridView.Template.DataSource;
}
set {
try {
controlContainingGridViewElement.GridView.Template.DataSource = value;
} catch (Exception ex) {
Debug.WriteLine(ex);
}
}
}
internal void SetupColumns(Action<MasterGridViewTemplate> setupColumns) {
controlContainingGridViewElement.GridView.Template.AutoGenerateColumns = false;
setupColumns(controlContainingGridViewElement.GridView.Template);
}
}
public class ControlContainingGridViewElement : RadElement {
private TextPrimitive textPrimitive = null;
private RadButtonElement addButton = null;
private RadButtonElement deleteButton = null;
private RadGridViewElement gridViewElement = null;
public RadGridViewElement GridView { get { return gridViewElement; } }
public bool ShowAddButton { get { return addButton.Visibility == ElementVisibility.Visible; } set { addButton.Visibility = value ? ElementVisibility.Visible : ElementVisibility.Collapsed; } }
public bool ShowDeleteButton { get { return deleteButton.Visibility == ElementVisibility.Visible; } set { deleteButton.Visibility = value ? ElementVisibility.Visible : ElementVisibility.Collapsed; } }
public string Text { get { return textPrimitive.Text; } set { textPrimitive.Text = value; } }
protected override void CreateChildElements() {
DockLayoutPanel dlp = new DockLayoutPanel();
dlp.StretchHorizontally = true;
dlp.StretchHorizontally = true;
dlp.LastChildFill = true;
DockLayoutPanel dlpBar = new DockLayoutPanel();
dlpBar.StretchHorizontally = true;
DockLayoutPanel.SetDock(dlpBar, Dock.Top);
var imagePrimitive = new ImagePrimitive();
DockLayoutPanel.SetDock(imagePrimitive, Dock.Left);
textPrimitive = new TextPrimitive();
DockLayoutPanel.SetDock(textPrimitive, Dock.Left);
var slp = new StackLayoutPanel();
DockLayoutPanel.SetDock(slp, Dock.Right);
var addButton = new RadButtonElement {
Text = "Add",
MaxSize = new Size() { Height = 20 }
};
var deleteButton = new RadButtonElement {
Text = "Del",
MaxSize = new Size() { Height = 20 }
};
slp.Children.Add(addButton);
slp.Children.Add(deleteButton);
dlpBar.Children.Add(slp);
dlpBar.Children.Add(imagePrimitive);
dlpBar.Children.Add(textPrimitive);
gridViewElement = new RadGridViewElement {
StretchHorizontally = true,
StretchVertically = true
};
gridViewElement.Template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
gridViewElement.Template.AllowAddNewRow = false;
gridViewElement.Template.AllowDeleteRow = false;
gridViewElement.Template.AllowDragToGroup = false;
gridViewElement.ShowGroupPanel = false;
gridViewElement.ShowGroupPanelScrollbars = false;
dlp.Children.Add(dlpBar);
dlp.Children.Add(gridViewElement);
this.Children.Add(dlp);
base.CreateChildElements();
}
}
During Form load, I programmatically add columns and provide a binding source
private List<SampleModel> sampleModels = new List<SampleModel>();
private BindingSource sampleModelsBinding = new BindingSource();
private void RadForm1_Load(object sender, EventArgs e) {
sampleModels.Add(new SampleModel() {
When = DateTime.Parse("1980-04-23"),
SomeText = "Purple Bananas",
IsTrue = true
});
sampleModels.Add(new SampleModel() {
When = DateTime.Parse("2002-07-20"),
SomeText = "Ball & Chain",
IsTrue = false
});
sampleModelsBinding.DataSource = sampleModels;
controlContainingGridView.SetupColumns((grid) => {
grid.AddDateTimeColumn(nameof(SampleModel.When), "When");
grid.AddTextBoxColumn(nameof(SampleModel.SomeText), "Some Text");
grid.AddCheckBoxColumn(nameof(SampleModel.IsTrue), "Is True");
});
controlContainingGridView.DataSource = sampleModelsBinding;
}
Inclusion of the CheckBox column results in the following error:
Exception thrown: 'System.NullReferenceException' in Telerik.WinControls.GridView.dll
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.GridCheckBoxHeaderCellElement.Attach(GridViewColumn data, Object context)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.InsertElement(Int32 position, IVirtualizedElement`1 element, T data)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.GridVirtualizedRowElement.MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
at Telerik.WinControls.UI.LightVisualElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.GridRowElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElementCore(RadElement element, SizeF availableSize)
at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureElementCore(RadElement element, SizeF availableSize)
at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElement(IVirtualizedElement`1 element)
at Telerik.WinControls.UI.PinnedRowsContainerElement.MeasureElement(IVirtualizedElement`1 element)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureViewElement(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureView(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.GridTableElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.Layouts.DockLayoutPanel.MeasureOverride(SizeF constraint)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
at Telerik.WinControls.UI.GridVisibilityHelper.EnsureRowVisible(GridViewRowInfo rowInfo)
at Telerik.WinControls.UI.GridTableElement.EnsureRowVisible(GridViewRowInfo rowInfo)
at Telerik.WinControls.UI.GridTableElement.EnsureCellVisible(GridViewRowInfo rowInfo, GridViewColumn column)
at Telerik.WinControls.UI.GridTableElement.UpdateViewCore(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridTableElement.UpdateView(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(GridViewEvent eventData)
at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(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.RaiseCurrentChanged(GridViewTemplate template, GridViewRowInfo row, GridViewColumn column, Boolean user)
at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CurrentChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Telerik.WinControls.Data.RadCollectionView`1.OnCurrentChanged(EventArgs args)
at Telerik.WinControls.Data.RadCollectionView`1.SetCurrentPositionCore(Int32 newPosition, Boolean forceNotify, CurrentChangeReason reason)
at Telerik.WinControls.Data.RadListSource`1.InitializeCurrentItem()
at Telerik.WinControls.Data.RadListSource`1.Initialize()
at Telerik.WinControls.Data.RadListSource`1.Bind(Object dataSource, String dataMember)
at Telerik.WinControls.Data.RadListSource`1.set_DataSource(Object value)
at Telerik.WinControls.UI.GridViewTemplate.set_DataSource(Object value)
at BugReproduction.ControlContainingGridView.set_DataSource(Object value) in ...\BugReproduction\BugReproduction\ControlContainingGridView.cs:line 42
Hi, Following to the workaroud (flag IsSearchAsync) provided (https://feedback.telerik.com/Project/154/Feedback/Details/245938-fix-radgridview-having-groups-filters-sort-descriptors-and-search-query-in-t), we discovered two issues : 1) the behavior of the grid is changed while using IsSearchAsync as true or false (see 2018-08-01_1849_DragDrop_behavior_with_IsSearchAsync.swf video attached). When set to true, the line found by the searchbox is automatically reselected. When the flag is set to false, it's not the case. 2) while playing with drag&drop, after some time the grid became unstable (see 2018-08-01_1847_-_dragdrop_issue_with_IsAsyncSearch.swf video attached). You can see that at the beginning, the D&D works fine. At 0:20 I can't select any line, and when I try to D&D, it drops always the same customer. At 0:40 you can see that even the SearchBox is broken and the progressbar is looping forever
To reproduce: please refer to the attached sample project and gif file Workaround: GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1); spreadExporter.ExportFormat = SpreadExportFormat.Pdf; spreadExporter.ExportVisualSettings = true; SpreadExportRenderer exportRenderer = new SpreadExportRenderer(); spreadExporter.RunExport(exportFile, exportRenderer); Process.Start(exportFile);
1. Create a new project and setup hierarchy 2. Add a large number of rows as child rows to the last row at first level 3. Run the project and try to expand the last row