Unplanned
Last Updated: 21 Nov 2017 09:40 by ADMIN
By default, when I am expanding a group and start sorting, the expanded group doesn't collapse. However, if you use a group comparer, all groups will always collapse, when you click a header cell to sort.
Unplanned
Last Updated: 20 Nov 2017 16:10 by ADMIN
To reproduce:
- Add 7-8 columns to the grid.
- Set the AutoSizeColumnsMode to Fill
- Set the MaxWidth/MaxWidth of the last two columns.
- Resize the first column.
- Sometimes the size of the other columns is randomly increased/decreased.

Unplanned
Last Updated: 20 Nov 2017 15:51 by ADMIN
This new API will be useful for implementing custom sorting scenarios when you need to have custom sorting only for a single column.

A similar API is available for the filtering functionality (MasterTemplate.DataView.FilterEvaluate)
Unplanned
Last Updated: 20 Nov 2017 15:37 by ADMIN
To reproduce: we have a RadPageView with two grids on two pages. The first grid has a ColumnGroupsViewDefinition applied. When you open the Property Builder and try to hide some of the columns, the error occurs.

Workaround: make the changes programamtically at run time.
Unplanned
Last Updated: 20 Nov 2017 13:52 by ADMIN
To reproduce: please refer to the attached gif file and sample project

Workaround: set the AutoSizeRows property to false
Completed
Last Updated: 13 Nov 2017 13:19 by Emad
ADMIN
Created by: Dimitar
Comments: 1
Category: GridView
Type: Bug Report
0
Use attached to reproduce.

Workaround:
class MyGridCheckBoxHeaderCellElement : GridCheckBoxHeaderCellElement
{
    public MyGridCheckBoxHeaderCellElement(GridRowElement row, GridViewColumn col) : base(col, row)
    {
    }
    bool suspenUpdate = false;
    protected override void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args)
    {
        suspenUpdate = true;
        base.checkbox_ToggleStateChanged(sender, args);
        suspenUpdate = false;
    }
    protected override void SetCheckBoxState()
    {
        if (!suspenUpdate)
        {
            base.SetCheckBoxState();
        }
        
    }
}

private void RadGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.Column != null&& e.CellType == typeof(GridCheckBoxHeaderCellElement))
    {
        e.CellElement = new MyGridCheckBoxHeaderCellElement(e.Row, e.Column);
    }
}

Unplanned
Last Updated: 08 Nov 2017 15:50 by ADMIN
To reproduce: run the project, select the grid and press Tab. You will notice a message box for the first grid which won't be shown for the second in the popup.
Completed
Last Updated: 02 Nov 2017 07:30 by ADMIN
In self-reference if you bind the grid to a record having is ParentId the same as its Id, the grid will try to create a row which is parented by itself. This is not valid input data and we should throw a proper exception, otherwise the application will freeze.

How to reproduce: 
public partial class Form2 : Form
{
    private BindingList<DataObject> data;

    public Form2()
    {
        InitializeComponent();

        this.radGridView1.AutoGenerateHierarchy = true;
        this.data = new BindingList<DataObject>();

        int count = 10;
        for (int i = 0; i < count; i++)
        {
            DataObject p = new DataObject();
            p.Id = i;
            p.Name = "Parent " + i;
            this.data.Add(p);

            for (int j = 0; j < count; j++)
            {
                DataObject c = new DataObject();
                c.Id = count + j + i * count;
                c.Name = "Child " + i;
                c.ParentId = i;
                this.data.Add(c);
            }
        }

        this.radButton1.Click += RadButton1_Click;
    }

    private void RadButton1_Click(object sender, EventArgs e)
    {
        if (this.radGridView1.Relations.Count > 0)
        {
            this.radGridView1.Relations.Clear();
        }

        this.radGridView1.DataSource = this.data;
        this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId");

    }
}

public class DataObject
{
    public int Id { get; set; }

    public string Name { get; set; }

    public int ParentId { get; set; }
}


Workaround: set the ParentId of the parent records

int count = 10;
for (int i = 0; i < count; i++)
{
    DataObject p = new DataObject();
    p.Id = i;
    p.Name = "Parent " + i;
    p.ParentId = -1;
    this.data.Add(p);

    for (int j = 0; j < count; j++)
    {
        DataObject c = new DataObject();
        c.Id = count + j + i * count;
        c.Name = "Child " + i;
        c.ParentId = i;
        this.data.Add(c);
    }
}
Completed
Last Updated: 02 Nov 2017 07:30 by ADMIN
Use attached to reproduce.

Workaround:
class MyDataCellElement : GridDataCellElement
{
    public MyDataCellElement(GridViewColumn col, GridRowElement row) : base(col,row)
    { }

    protected override List<CharacterRange> GetSearchHighlightRanges()
    {
        // return base.GetSearchHighlightRanges();
        List<CharacterRange> ranges = new List<CharacterRange>();

        if (this.ColumnInfo == null || !this.RowInfo.SearchCache.Contains(this.ColumnInfo))
        {
            return ranges;
        }

        string criteria = this.RowInfo.SearchCache[this.ColumnInfo] as string;

        int index = -1;


        CompareOptions options;

        if (this.MasterTemplate.MasterViewInfo.TableSearchRow.CaseSensitive)
        {
            options = CompareOptions.Ordinal;
        }
        else
        {
            options = this.MasterTemplate.MasterViewInfo.TableSearchRow.CompareOptions;
        }

        do
        {
            if (index + 1 >= this.Text.Length)
            {
                break;
            }

            index = this.MasterTemplate.MasterViewInfo.TableSearchRow.Culture.CompareInfo.IndexOf(this.Text, criteria, index + 1, options);

            if (index >= 0)
            {
                var str = this.Text.Substring(index, criteria.Length);
                 
                int symbolCount = 0;
                foreach (char ch in str)
                {
                    if (!Char.IsLetterOrDigit(ch))
                    {
                        symbolCount++;
                    }
                }

                ranges.Add(new CharacterRange(index, criteria.Length + symbolCount));
            }

        } while (index >= 0 && ranges.Count < 32);

        return ranges;
    }
}

private void MasterTemplate_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType == typeof(GridDataCellElement))
    {
        e.CellElement = new MyDataCellElement(e.Column, e.Row);
    }
   
}
Unplanned
Last Updated: 20 Oct 2017 08:44 by ADMIN
Completed
Last Updated: 12 Oct 2017 12:18 by ADMIN
How to reproduce:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.EditorRequired += RadGridView1_EditorRequired;
    }

    private void RadGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        if (this.radGridView1.CurrentColumn.Index == 0)
        {
            e.Editor = new RadTimePickerElement();
        }
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Date", typeof(DateTime));

        for (int i = 0; i < 20; i++)
        {
            DataRow r = dt.NewRow();
            dt.Rows.Add(r);
        }
        
        return dt;
    }
}

Workaround: the scenario is not completely valid as when handling the EditorRequiredEvent one should use the GridTimePickerEditor
1. Use the column`s EditorType property: 
((GridViewDateTimeColumn)this.radGridView1.Columns["Date"]).EditorType = GridViewDateTimeEditorType.TimePicker
2. Alternatively, handle the event this way:
private void RadGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
    if (this.radGridView1.CurrentColumn.Index == 0)
    {
        e.Editor = new GridTimePickerEditor();
    }
}
Completed
Last Updated: 11 Oct 2017 12:10 by ADMIN
To reproduce: run the attached sample project and click the new row.

Workaround: don't call the Begin/EndUpdate methods in the CurrentRowChanged event.
Completed
Last Updated: 10 Oct 2017 12:22 by ADMIN
How to reproduce: check the attached project

Workaround: create a custom RadListFilterPopup
public class MyRadListFilterPopup : RadListFilterPopup
    {
        public MyRadListFilterPopup(GridViewDataColumn dataColumn, bool groupedDateValues)
            : base(dataColumn, groupedDateValues)
        { }

        protected override void OnButtonOkClick(EventArgs e)
        {
            FilterOperator filterOperator = FilterOperator.IsEqualTo;

            IRadListFilterElement listFilterElement = (IRadListFilterElement)typeof(RadListFilterPopup).GetField("listFilterElement", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            RadListFilterDistinctValuesTable selectedValues = listFilterElement.SelectedValues;

            switch (listFilterElement.SelectedMode)
            {
                case ListFilterSelectedMode.All:
                    filterOperator = FilterOperator.None;
                    break;
                case ListFilterSelectedMode.Null:
                    filterOperator = FilterOperator.IsNull;
                    break;
                case ListFilterSelectedMode.NotNull:
                    filterOperator = FilterOperator.IsNotNull;
                    break;
            }

            if (filterOperator != FilterOperator.IsEqualTo)
            {
                SetFilterOperator(filterOperator);
                this.ClosePopup(RadPopupCloseReason.CloseCalled);
            }
            else
            {
                CompositeFilterDescriptor compositeFilterDescriptor = new CompositeFilterDescriptor();
                compositeFilterDescriptor.PropertyName = this.DataColumn.Name;
                RadListFilterDistinctValuesTable distinctValues = this.GetDistinctValuesTable();
                string blanksKey = RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadGridStringId.FilterMenuBlanks);
                bool blanks = selectedValues.Contains(blanksKey);
                if (selectedValues.Count > distinctValues.Count / 2 && !blanks)
                {
                    compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.And;

                    foreach (DictionaryEntry entry in distinctValues)
                    {
                        string key = (string)entry.Key;
                        if (string.IsNullOrEmpty(key))
                        {
                            key = blanksKey;
                        }

                        if (!selectedValues.Contains(key))
                        {
                            foreach (object value in (ArrayList)entry.Value)
                            {
                                FilterDescriptor descriptor;
                                if (value == DBNull.Value)
                                {
                                    descriptor = new FilterDescriptor(this.DataColumn.Name, FilterOperator.IsNotEqualTo, null);
                                }
                                else if (this.DataColumn is GridViewDateTimeColumn || this.DataColumn.DataType == typeof(DateTime) || this.DataColumn.DataType == typeof(DateTime?))
                                {
                                    descriptor = new DateFilterDescriptor(this.DataColumn.Name, FilterOperator.IsNotEqualTo, (DateTime?)value, false);
                                }
                                else
                                {
                                    descriptor = new FilterDescriptor(this.DataColumn.Name, FilterOperator.IsNotEqualTo, value);
                                }

                                compositeFilterDescriptor.FilterDescriptors.Add(descriptor);
                            }
                        }
                    }
                }
                else
                {
                    compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or;

                    foreach (DictionaryEntry entry in selectedValues)
                    {
                        foreach (object value in (ArrayList)entry.Value)
                        {
                            FilterDescriptor descriptor;
                            if (value == DBNull.Value)
                            {
                                descriptor = new FilterDescriptor(this.DataColumn.Name, FilterOperator.IsNotEqualTo, null);
                            }
                            else if (this.DataColumn is GridViewDateTimeColumn || this.DataColumn.DataType == typeof(DateTime) || this.DataColumn.DataType == typeof(DateTime?))
                            {
                                descriptor = new DateFilterDescriptor(this.DataColumn.Name, FilterOperator.IsEqualTo, (DateTime?)value, false);
                            }
                            else
                            {
                                descriptor = new FilterDescriptor(this.DataColumn.Name, FilterOperator.IsEqualTo, value);
                            }

                            compositeFilterDescriptor.FilterDescriptors.Add(descriptor);
                        }
                    }
                }

                this.FilterDescriptor = compositeFilterDescriptor;
                OnFilterConfirmed();
            }
        }
    }
Completed
Last Updated: 11 Sep 2017 10:27 by ADMIN
To reproduce: bind the grid to a DataTable where one of the columns doesn't allow null values. Try to add a new record by using the new row in the grid. Even though you specify default values in the DefaultValuesNeeded event, the error still occurs. Please refer to the attached sample project and gif file.

Workaround: handle the RadGridView.DataError event:

private void RadGridView1_DataError(object sender, Telerik.WinControls.UI.GridViewDataErrorEventArgs e)
{
    if (e.Exception.ToString().Contains("does not allow nulls"))
    {
        e.Cancel = true;
    }
}
Completed
Last Updated: 05 Sep 2017 09:42 by ADMIN
Currently, DisplayFormatType.GeneralDate, DisplayFormatType.ShortDate, DisplayFormatType.MediumDate all return culture's DateTimeFormat.ShortDatePattern. 

Workaround: 
GridViewDateTimeColumn columnDateTime = this.radGridView1.Columns["Date"] as GridViewDateTimeColumn;
columnDateTime.ExcelExportType = DisplayFormatType.Custom; 
columnDateTime.ExcelExportFormatString  = "dd/MM/yyyy hh:mm:ss";
Completed
Last Updated: 05 Sep 2017 08:04 by ADMIN
How to reproduce check the attached project: 

Workaround: Create a custom spread export renderer

public class MySpreadExportRenderer : SpreadExportRenderer
{
    public override void AddWorksheet(string sheetName)
    {
        string name = "";

        Workbook wb = (Workbook)typeof(SpreadExportRenderer).GetField("workbook", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        if (sheetName == null || sheetName == string.Empty)
        {
            name = "Sheet_" + (wb.Worksheets.Count + 1);
        }
        else
        {
            name = sheetName;
        }

        if (wb.Worksheets.Where(w => w.Name == name).ToList().Count == 0)
        {
            base.AddWorksheet(sheetName);
        }
        else
        {
            typeof(SpreadExportRenderer).GetField("worksheet", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, wb.Worksheets.Add());
        }
    }
}

Unplanned
Last Updated: 27 Aug 2017 14:34 by mostafa
When I add summary rows to my radgridview. something strange is happening.
I demonstrate it to you in two pictures. please take a look at attachments
Declined
Last Updated: 18 Aug 2017 05:24 by mostafa
Created by: mostafa
Comments: 2
Category: GridView
Type: Feature Request
1
Hi Mostafa,

The end users can copy a single cell even when the SelectionMode is set to FullRowSelect via the ContextMenu when opening it on any of the data cells. If the context menu is opened on the row header they will select the whole row. Please check the attached video: radgridview-context-menu-behavior.gif.

If you would like to copy a single cell using the Ctrl-C command and have the grid setup in FullRowSelect mode please check the attached project featuring a solution. I am also attaching a video showing the result using the custom implementation in the project: radgridview-full-row-ctrl-c.gif