Declined
Last Updated: 27 Jul 2023 12:43 by ADMIN
When the FreeFormDateTime mask type is used with the RadDateTimeEditor, the Validate method is not called again after entering an invalid value. Even if we type a valid date afterward, the control rollback to the previous value of the cell.
Declined
Last Updated: 16 Feb 2024 22:24 by ADMIN

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());

  }

Declined
Last Updated: 04 Jan 2022 16:02 by ADMIN

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;

Declined
Last Updated: 14 Jun 2021 09:13 by ADMIN
  1. Using a RadGriditem
  2. Set AllowSearchRow to false as default
  3. Add a RadButton or something else to toggle AllowSearchRow
  4. Toggling works as long the "x" in the search mask is not used

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.

Declined
Last Updated: 06 Apr 2021 13:19 by ADMIN
Created by: Trustteam
Comments: 1
Category: GridView
Type: Bug Report
0

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

 

Declined
Last Updated: 19 Nov 2021 09:52 by ADMIN
Created by: dev
Comments: 4
Category: GridView
Type: Bug Report
1

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

 

 
Declined
Last Updated: 16 Feb 2024 19:51 by ADMIN
Created by: Lior
Comments: 2
Category: GridView
Type: Bug Report
0

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.

 

Declined
Last Updated: 28 Jan 2020 09:56 by ADMIN

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

Declined
Last Updated: 12 Nov 2019 14:52 by ADMIN

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

Declined
Last Updated: 27 May 2022 14:15 by ADMIN
Scheduled for R2 2022 SP1
The decimal separator is removed when exporting with German culture on Windows Server 2012
Declined
Last Updated: 05 Apr 2019 14:30 by ADMIN

To reproduce:

Update the data source directly and check the OldItems array.

Declined
Last Updated: 19 Nov 2018 16:15 by ADMIN
To reproduce:
- Use a column with numbers stored as strings.
- Set the data type to decimal
- The columns should be sorted according to the number value not alphabetically.

Workaround:
var col = new GridViewTextBoxColumn();
col.DataTypeConverter = new DecimalConverter();
col.FieldName = "Dosage";
col.UseDataTypeConverterWhenSorting = true;
col.DataType = typeof(decimal);
radGridView1.Columns.Add(col);

public class DecimalConverter : TypeConverter
{
    public override bool CanConvertTo(ITypeDescriptorContext context, Type destination_type)
    {
        
        if (destination_type == typeof(decimal))
        {
            return true;
        }

        return base.CanConvertTo(context, destination_type);
    }
    public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destination_type)
    {
        if (destination_type == typeof(decimal))
        {
            return decimal.Parse(value.ToString());
        }

        return base.ConvertTo(context, culture, value, destination_type);
    }
}
Declined
Last Updated: 27 Sep 2019 10:43 by ADMIN
ADMIN
Created by: Telerik Admin
Comments: 5
Category: GridView
Type: Bug Report
1
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
Declined
Last Updated: 13 Sep 2019 07:11 by ADMIN
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);
Declined
Last Updated: 29 Jun 2018 13:01 by ADMIN
Use attached to reproduce.

With versions prior 2015.3.930 the results are different.
Declined
Last Updated: 26 Feb 2018 17:39 by Mike
To reproduce:
Public Class RadForm1
    Public RadGridView1 As RadGridView

    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load
        CreateGrid()
        FormatGrid()
        SetDataSource()
    End Sub

    Private Sub CreateGrid()
        Try
            RadGridView1 = New RadGridView
            Me.Controls.Add(RadGridView1)
        Catch ex As Exception
            MessageBox.Show(Me, ex.Message)
        End Try
    End Sub
    Private Sub FormatGrid()

        Dim col As GridViewTextBoxColumn
        With RadGridView1
            col = New GridViewTextBoxColumn
            With col
                .FieldName = "FieldID"
                'NOTE: Comment out NullValue = "" to prevent the unhandled exception
                .NullValue = ""
            End With
            .Columns.Add(col)
        End With
    End Sub
    Private Sub SetDataSource()
        Dim table As DataTable = Nothing
        Dim row As DataRow = Nothing
        table = New DataTable("GridList")
        table.Columns.Add("FieldID", GetType(System.Guid))
        row = table.NewRow
        row("FieldID") = Guid.Empty
        table.Rows.Add(row)
        RadGridView1.DataSource = table
    End Sub
End Class

Workaround:
Comment this line 
NullValue = ""
Declined
Last Updated: 27 Jun 2018 10:14 by ADMIN
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)

Declined
Last Updated: 06 Jun 2018 07:31 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 1
Category: GridView
Type: Bug Report
1
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);
}
Declined
Last Updated: 29 Nov 2017 11:03 by ADMIN
Create a grid with more than 20 columns and add 5K rows for example. Maximize the form and try to scroll with mouse wheel. You will notice that the scrolling performance is worse compared to the normal state of the form with less visible visual elements.

Workaround: this.radGridView1.EnableFastScrolling = true; and use the scrollbar's thumb

Second workaround: use paging:  https://docs.telerik.com/devtools/winforms/gridview/paging/overview Thus, you will display as many rows as possible to display on the screen per page. Instead of scrolling, you will navigate through pages.
Declined
Last Updated: 17 May 2017 05:15 by ADMIN
To reproduce: please refer to the attached sample project. 

Workaround:   this.radGridView1.TableElement.ScrollToRow(this.radGridView1.RowCount-1);
1 2 3 4 5