Unplanned
Last Updated: 16 Feb 2024 12:27 by Martin
Created by: Martin
Comments: 4
Category: UI for WinForms
Type: Feature Request
0

I would like to have a generic validation-mechanism, implemented in all controls. Hear me out:

A class ValidationInformation for containing all sort of validation information for a certain field, property, cell, etc. which has properties likes:

  • Type DataType
  • object MinValue
  • object MaxValue
  • int? MinLength
  • int? MaxLength
  • bool IsRequired
  • RegEx Mask
  • etc.

It also has a virtual method like bool Validate(object entity, object value, out string validationError).

A base class ValidationInformationProvider for retrieving validation information from various sources. It has some abstract methods for retrieval, storing/caching information per cell/field/property.

This base class has the following subclasses:

  • ValidationInformationProviderFromDataTable
  • ValidationInformationProviderFromAnnotations
  • ValidationInformationProviderFromXXX

Each provider is responsible for reading validation information from the source (DataTable, annotations on a property, etc.) and fill a ValidationInformation object.

Now the fun begins...

Each Telerik class, like RadGridView and/or subcomponents should get a method or event to retrieve ValidationInformation. When the event is not handled or the method returns null, the default behavior kicks in.

When ValidationInformation is provided, default behavior is overridden. Properties of editors van be set with values from ValidationInformation (like Minimum and Maximum of a GridViewDecimalColumnPlus or RadSpinEditorElement). At the end if editing the method ValidationInformation.Validate is called to validate the new value. The validation error can be used for popups, or tooltips, or an exception. 

This way a user does not have to think where to set which property of any Telerik control for any validation. This way a RadPropertyGrid and RadGridView can work the same way when it comes to data validation, regardless of all editors which work in the background. 

Completed
Last Updated: 01 Nov 2022 13:06 by ADMIN
Release R3 2022 SP2
Created by: Martin
Comments: 1
Category: UI for WinForms
Type: Feature Request
0

This is about the following method:

        public void SetError(GridViewCellCancelEventArgs e, Exception exception)
        {
            GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
            if (e != null)
            {
                args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
            }
            this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);

            if (args.ThrowException)
            {
                throw args.Exception;
            }

            if (args.Cancel)
            {
                //TODO: cancel row edit 
            }
        }

Right now, the method GridViewTemplate.SetError accepts a parameter of type GridViewCellCancelEventArgs, which in itself is weird, because event args should only be used inside events and OnXXX-methods. But since SetError fires an event, one could argue that this method is like a OnXXX-method.

But inside it becomes more weird, it translates GridViewCellCancelEventArgs into GridViewDataErrorEventArgs. And I must admit, the last DataError-args feel a lot more logical that CellCancel-args when firing setting an error. Furthermore, if I create an override of class GridViewCellCancelEventArgs to contain more data about an error, this information never reaches the event handlers.

So why this translation? Or better: Why this parameter?

My suggestion would be to make a new overload:


public void SetError(GridViewDataErrorEventArgs e)
{
    if (e == null)
        throw new ArgumentNullException(nameof(e));

        this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);

        if (args.ThrowException)
                throw args.Exception;

        if (args.Cancel)
        {
                // TODO: I really do not know what telerik wanted to do here, so I live this up to Telerik.
        }
}
Furthermore you could consider markering the other SetError-methods as obsolete.
Completed
Last Updated: 05 Apr 2023 10:02 by ADMIN
Release R1 2023 SP1

This is about this method:

        public void SetError(GridViewCellCancelEventArgs e, Exception exception)
        {
            GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
            if (e != null)
            {
                args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
            }
            this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);

            if (args.ThrowException)
            {
                throw args.Exception;
            }

            if (args.Cancel)
            {
                //TODO: cancel row edit 
            }
        }

The method GridViewTemplate.SetError accepts a parameter of type GridViewCellCancelEventArgs (named e), but uses the information to create a new object of type GridViewDataErrorEventArgs (named args) and uses information from e to fill args.

The method then fires an event with args. Args also has a property Cancel which can be set in the event handlers. But nothing is done with that property.

Parameter e also has a property Cancel which is never be filled. So it could be useful, at the end of SetError, to set e.Cancel with args.Cancel. This way the caller can use the Cancel information from the events.

This request is also related to my next request. 

PS: Why is GridViewCellCancelEventArgs  called this way? It implies it has arguments for an event, but it is not used for an event, am I right?

Completed
Last Updated: 01 Nov 2022 13:07 by ADMIN
Release R3 2022 SP2

The method GridViewTemplate.SetError creates in most situations an GridViewDataErrorEventArgs object twice.

Current code:

GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
if (e != null)
{
    args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
}

In assume in most cases e will not be null, so in must cases the first args will be removed. This has a small negative impact on memory and performace.

Suggestion:

GridViewDataErrorEventArgs args = e == null 
    ? new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit)
    : new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);

Completed
Last Updated: 02 Feb 2023 09:34 by ADMIN
Release R1 2023
Created by: Wenyu
Comments: 1
Category: UI for WinForms
Type: Bug Report
0

After installing R3 2022, the QuickStart example can't be run:

 

 
Completed
Last Updated: 12 Oct 2022 12:36 by ADMIN
Release R3 2022 SP2
Created by: Martin
Comments: 7
Category: UI for WinForms
Type: Bug Report
0

Repro-steps

  1. Create a Form
  2. Add a RadGridView control
  3. Add two Text columns
  4. Run the form
  5. Add a new row to the RadGridView with values "a" and "b"
  6. Add a another row to the RadGridView with values "c" and "d"
  7. Select the first row and copy the row values
  8. Select the first cell of the second row and paste the values

Expected behavior

  • The values "a" and "b" are in the second row

Observed behavior

  • The values "ab" and "d" are in the second row

 

Completed
Last Updated: 12 Oct 2022 06:42 by ADMIN
Release R3 2022 SP2

Repro-steps

  1. Create a Form
  2. Add a RadGridView control
  3. Add two Text columns
  4. Run the form
  5. Add a new row to the RadGridView with values "a" and "b"
  6. In Excel fill a row with two cells with values "c" and "d"
  7. Select those cells and copy them to the clipboard
  8. In the RadGridView select the first cell of the row
  9. Paste the data

Expected behavior

  • The values "c" and "d" are in the row

Observed behavior

  • The values "System.IO.MemoryStream" and "b" are in the row

Extra info

If the first column is of another type (like GridViewDecimalColumn) a DataError occurs (because "System.IO.MemoryStream" cannot be parces to a decimal).

 

Unplanned
Last Updated: 29 Sep 2022 13:03 by ADMIN
Created by: erwin
Comments: 3
Category: UI for WinForms
Type: Bug Report
1

To replicate the missing button when the application is run on my main monitor with 150% DPI scaling:



If the RadControl.EnableRadAutoScale property is set to false in the Program.cs file, the button is placed as expected:



When I replace the form to inherit from RadForm, not the MS Form, the button is clipped:

Completed
Last Updated: 11 Oct 2022 12:23 by ADMIN
Release R3 2022 SP2
Created by: Sandor
Comments: 2
Category: UI for WinForms
Type: Bug Report
0
The latest public release Telerik_UI_For_WinForms_2022_3_921_source.zip contains all of the git repository its 1001 MB, while the lastest was 224 MB.
Completed
Last Updated: 02 Feb 2023 09:36 by ADMIN
Release R1 2023

To reproduce the issue, just drag a RadToggleSwitch to the form. Then, at run time call the method:

radToggleSwitch1.SetToggleState(newValue: false, animate: false);

You will notice that the colors are changed but the thumb is not moved: 

Workaround:

            this.radToggleSwitch1.AllowAnimation = false;
            this.radToggleSwitch1.Toggle();

Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022

ThemeResolutionService.ApplicationThemeName = "Office2019Dark"; this.radDropDownList1.EnableAlternatingItemColor = true;

Completed
Last Updated: 27 Mar 2023 06:39 by ADMIN
Release R1 2023 SP1

Hi,

I am using CalHelper to convert recurrence rule to and from string.

It looks like when I convert rule to string and then parse it back to recurrence, some of the properties get dropped.

Please see below from my VS editor highlighting this:

 

Am I doing something wrong, or is this a bug?

 

Thanks

Anu

Completed
Last Updated: 01 Nov 2022 13:52 by ADMIN
Release R3 2022 SP2
Created by: Desislava
Comments: 0
Category: UI for WinForms
Type: Feature Request
0

The ChartLegendElement displays the legend items in a StackLayoutElement which can be either vertical or horizontal.

        public RadForm1()
        {
            InitializeComponent();

            Random rand = new Random();
            List<LineSeries> list = new List<LineSeries>();
            for (var index = 1; index <= 15; index++)
            {
                LineSeries ls = new LineSeries();
                ls.LegendTitle = "Series " + index;
                list.Add(ls);
            }

            for (int index = 1; index <= 100; index++)
            {
                foreach (LineSeries s in list)
                    s.DataPoints.Add(new CategoricalDataPoint(index, rand.Next(0, rand.Next(5, 20))));
            }
            this.radChartView1.Series.AddRange(list.ToArray());
            this.radChartView1.ShowLegend = true;
            this.radChartView1.ChartElement.LegendPosition = LegendPosition.Bottom;
            this.radChartView1.ChartElement.LegendElement.StackElement.Orientation = Orientation.Vertical;
        }

Horizontal:

Vertical:

It would be good to provide an option for wrapping the legend items:

chartview-wrap-legend-items002

Workaround: use an appropriate container for the legend items to wrap the legend item and use the space more efficiently

https://docs.telerik.com/devtools/winforms/knowledge-base/chartview-wrap-legend-items 

 

Declined
Last Updated: 03 Aug 2022 08:08 by ADMIN

The version of Telerik products is requested as information where submitting a support ticket. In case one forgot the version currently installed, there is no way to find it (may be I am the only one who don't know). Usually most software provide such information in the "About" box. I found it difficult and not very useful that the "About" menu of Telerik connect to the Progress Home Page instead of displaying some useful information about the current installation (user name, version, installed components, license status, etc....). There are already many other actions (request support, online documentation, etc...) that connect to the web site. The "About" box should just be displayed within VS and provide information on the installation. Or at least you link it to the Progress Control Panel and adding a page for information I mentioned and more that user may need to know when needed.

Below is an example from VS.

Declined
Last Updated: 16 Feb 2024 22:22 by ADMIN

I just upgraded to the latest version of Telerik products and facing the issues described below.

When dragging and drop Telerik UI objects from the toolbar on a form, the dialog box below is displayed with question but there is no button to click to answer the question and I don't where to stop it.

See screenshot attached.

Unplanned
Last Updated: 01 Aug 2022 08:45 by ADMIN

Repro-steps

  1. Create a RadGridView
  2. Fill it with 8000 rows
  3. Select all rows
  4. Delete all rows and measure the time
  5. Repopulate the same grid with the same 8000 rows
  6. Sort on a column
  7. Select all rows
  8. Delete all rows and measure the time

Expected behavior

  • Both measured times are the same

Observed behavior

  • Deleting rows when a column is sorted take muuuuuuuuch more time

The problem is, after each (!!!) deleted row (not after all deleted rows) the sort-routine kicks in. Sorting all remaining rows. That is 7999 times to many.

One can argue that sorting after deleting something is not required at alle, since the order of the remaining rows (in this case none, but in one cases maybe more) will never change.

I also noticed a HybridIndex is used, possibly to increase performance during adding. Somehow it might hinder performance during deleting stuff.

Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
Created by: Martin
Comments: 1
Category: UI for WinForms
Type: Bug Report
0

Searching for a workaround for a previously reported bug, in walked into a little thing:


private void SelectAllCells()
    {
      GridViewRowInfoEnumerator rowInfoEnumerator = new GridViewRowInfoEnumerator((IHierarchicalRow) this.GridViewElement.Template);
      List<GridViewCellInfo> gridViewCellInfoList = new List<GridViewCellInfo>();
      this.MasterTemplate.SelectedCells.BeginUpdate();
      this.MasterTemplate.SelectedCells.Clear();
      while (rowInfoEnumerator.MoveNext())
      {
        GridViewRowInfo current = rowInfoEnumerator.Current;
        if (current.CanBeSelected)
        {
          foreach (GridViewCellInfo cell in current.Cells)
            this.MasterTemplate.SelectedCells.Add(cell);
        }
      }
      this.MasterTemplate.SelectedCells.EndUpdate(true);
    }
The local gridViewCellInfoList is never used and can therefore be removed, improving performance and memory usage in very very very small way.
Unplanned
Last Updated: 02 Aug 2022 12:41 by ADMIN

This bug is not about RadGridView, but about this ticketing system. I simply did not know where to send it.

Repro steps

  1. Go to a ticket with a question/answer with a link inside of it (for example, ticket: https://feedback.telerik.com/winforms/1573736-radgridview-oncreaterowinfo-not-being-called-when-user-is-adding-a-new-row
  2. Write a nice response with bold texts, paragraphs, etc. Do not send it yet.
  3. In the original text, press on the link. You leave the page.
  4. Right now be very scared that you might have lost your answer and press BACK.
  5. You go back to the back where you were writing your answer.

Expected behavior

  • Your answer is still there as it was, including all formatting.

Observed behavior

  • Your answer is still there, but all formatting has been replaced by HTML-tags, and no button or way to convert this HTML to formatted text.
Unplanned
Last Updated: 17 Apr 2024 14:40 by ADMIN

Repro-steps:

  1. Create a RadGridView
  2. MultiSelect = true
  3. SelectionMode = CellSelect
  4. Fill it with lots of cells (in my case: 7 columns, 8544 rows)
  5. Press CTRL-A
  6. Press Delete

Expected behavior:

  • All rows are gone

Observed behavior:

  • 50/50 change that some rows remain.

I traced the problem back to the method GridViewSleectedCellsCollection.IsSelected / GetHashCodeString.

internal bool IsSelected(GridViewRowInfo row, GridViewColumn column) => row != null && column is GridViewDataColumn && this.hashtable.Contains((object) this.GetHashCodeString(row, column));

When a cell is selected with GridViewCellInfo.IsSelected = true, it checks if it has already been selected. It does so by calling GridViewSleectedCellsCollection.IsSelected. which checks if a HasCodeString is already in a hashtable. But, when another selected cell has the same HasCodeString, the result is (incorrectly) true, which will result in not added it to the collection of selected cells. 

I guess that is can be easily fixed by changing:

 private string GetHashCodeString(GridViewRowInfo row, GridViewColumn column)
    {
      int hashCode = row.GetHashCode();
      string str1 = hashCode.ToString();
      hashCode = column.GetHashCode();
      string str2 = hashCode.ToString();
      return str1 + str2;
    }

to:

 private string GetHashCodeString(GridViewRowInfo row, GridViewColumn column)
    {
      int hashCode = row.GetHashCode();
      string str1 = hashCode.ToString();
      hashCode = column.GetHashCode();
      string str2 = hashCode.ToString();
      return str1 + "_" + str2;
    }

Since hashcodes 1 + 23 will result in the same string as hashcodes 12 + 3.

Making this change will reduce the problem significantly, but not entirely since hashCodes will never be unique.

Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022

I am rewriting the RadGridViewPaste-mechanism. Therefor I want to call PastingCellClipboardContent-event using the EventDispatcher.CellClipboardPaste. therefor I need the class GridViewCellValueEventArgs. It has two constructors:

  1. A constructor with indexes. If this one is used, properties RowInfo and Column will always be null.
  2. A constructor which accepts a row and column as parameters. All properties are set and usable.

The second constructor is marked as Internal, not Public. 

Request: Can this constructor be made Public?