Completed
Last Updated: 12 Oct 2016 08:35 by ADMIN
To reproduce:

public RadForm1()
{
    InitializeComponent();
    DataTable dt = new DataTable();
    for (int i = 0; i < 10; i++)
    {
        dt.Columns.Add("Col" + i);
    }

    for (int i = 0; i < 50; i++)
    {
        DataRow dr = dt.NewRow();
        foreach (DataColumn col in dt.Columns)
        {
            dr[col.ColumnName] = "Data." + i + "." + dt.Columns.IndexOf(col);
        }
        dt.Rows.Add(dr);
    }

    this.radGridView1.DataSource = dt;
    this.radGridView1.MasterTemplate.EnablePaging = true;
    this.radGridView1.MasterTemplate.ShowGroupedColumns = true;
}

public void ExportContactToExcelFile(string strFileName)
{
    GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1);
    SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
       
    spreadExporter.PagingExportOption = PagingExportOption.AllPages;
    spreadExporter.ExportVisualSettings = true;
    spreadExporter.SheetName = "Contacts";
    spreadExporter.RunExport(strFileName, exportRenderer);
}

private void radButton1_Click(object sender, EventArgs e)
{
    ExportContactToExcelFile(@"..\..\Export" + DateTime.Now.ToLongTimeString().Replace(":", "_") + ".xlsx");
}
 
Workaround: refresh the MasterTemplate after the export:

private void radButton1_Click(object sender, EventArgs e)
{
    ExportContactToExcelFile(@"..\..\Export" + DateTime.Now.ToLongTimeString().Replace(":", "_") + ".xlsx");
    this.radGridView1.MasterTemplate.Refresh();
}
Completed
Last Updated: 26 Sep 2016 07:34 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    GridViewComboBoxColumn comboCol = new GridViewComboBoxColumn();         
    comboCol.DataSource = InitComboActive();
    comboCol.ValueMember = "ActiveCode";
    comboCol.DisplayMember = "ActiveDsc";
    comboCol.FieldName = "ActiveCode";

    this.radGridView1.Columns.Add(comboCol);

    this.radGridView1.AutoGenerateColumns = false;
    BindRadGrid();
    this.radGridView1.CellValueChanged += radGridView1_CellValueChanged;
}

private void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e)
{
    BindRadGrid();
}

private void BindRadGrid()
{
    this.radGridView1.DataSource = null;
    this.radGridView1.DataSource = InitComboData();
}

private DataTable InitComboActive()
{
    DataTable dt = new DataTable("DtActive");
    dt.Columns.Add("ActiveCode");
    dt.Columns.Add("ActiveDsc");

    dt.Rows.Add("0", "InActive");
    dt.Rows.Add("1", "Active");

    return dt;
}

private DataTable InitComboData()
{
    DataTable dt = new DataTable("DtData");
    dt.Columns.Add("Host");
    dt.Columns.Add("ActiveCode");
    dt.Columns.Add("ActiveDsc");
    
    dt.Rows.Add("Host A", "0", "InActive");
    dt.Rows.Add("Host B", "1", "Active");

    return dt;
}

Workaround: use the RadGridView.CellEndEdit instead for rebinding. 
Workaround 2: use the CellValidated event:
private void radGridView1_CellValidated(object sender, CellValidatedEventArgs e)
{
    if (e.Row is GridViewDataRowInfo)
    {
        BindRadGrid();
    }
}

Unplanned
Last Updated: 17 Aug 2016 08:29 by ADMIN
Create a DataTable with columns Column1, Column2, Column3, Column4, Column5, and bound to RadGridView. Create a second DataTable with columns Column1, Column2a, Column3, Column4, Column5, and re-bind the RadGridView to this DataTable. Instead of the columns appearing in the same order as they are in the second DataTable, they show up as Column1, Column3, Column4, Column5, Column2a in the RadGridView. 
Completed
Last Updated: 26 Jan 2017 10:31 by ADMIN
Please refer to the attached sample project. Activate the editor for the "Notes" column of the first row, don't perform any changes and click another row. You will notice that the  DataRow.RowState is Modified although no change is performed. If you perform the same actions with a MS DataGridView, the RowState is not Modified.

Note: the GridViewRowInfo.IsModified property in the CellEndEdit is also set to true without modifying the cell's value. 

Workaround: handle the CellBeginEdit and CellEndEdit events and compare the values before and after the edit operation:

object initialValue = null;

private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    initialValue = e.Row.Cells[e.ColumnIndex].Value;
}

private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e)
{
    if (initialValue != e.Value)
    {
        Console.WriteLine("modified");
    }
    else
    {
        Console.WriteLine("NOT modified");
    }
}
Completed
Last Updated: 20 Sep 2016 07:33 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Bug Report
0
When you export ht grid content to HTML, the exported table contains an 'width' attribute set to 0. It is not possible to change this attribute. This prevents the HTML to be loaded correctly in RadRichTextEditor later.
Completed
Last Updated: 23 Aug 2016 10:07 by ADMIN
Workaround: change the name of the column
this.radGridView1.Columns["Table:Name"].Name = "Table|Name";
Completed
Last Updated: 18 Oct 2016 10:19 by ADMIN
To reproduce:

private void Form1_Load(object sender, EventArgs e)
{
    this.order_DetailsTableAdapter.Fill(this.nwindDataSet.Order_Details);

    this.radGridView1.DataSource = this.orderDetailsBindingSource;
    this.radGridView1.EnablePaging = true;
    this.radGridView1.AutoSizeRows = true;
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radGridView1.PrintStyle.PrintAllPages = true;
    this.radGridView1.PrintPreview();
} 

Workaround:  refresh the MasterTemplate after the PrintPreview dialog is closed: 

this.radGridView1.PrintPreview();

this.radGridView1.MasterTemplate.Refresh();
Completed
Last Updated: 28 Dec 2016 09:11 by ADMIN
To reproduce:
- Add a grid to a form and set the EnableHotTracking property to false in the properties window.
- When the application is started the property is reset.

Workaround:
Set the property at runtime.
Completed
Last Updated: 07 Dec 2016 13:49 by ADMIN
To reproduce:

DataTable dt = new DataTable();

public Form1()
{
    InitializeComponent();
 
    for (int i = 0; i < 5; i++)
    {
        dt.Columns.Add("Col" + i);
    }
     
    for (int i = 0; i < 5; i++)
    {
        DataRow row = dt.NewRow();
        dt.Rows.Add(row);
        foreach (DataColumn col in dt.Columns)
        {
            row[col.ColumnName] = randomWord(2, 14);
        }
    }
}

static Random r = new Random();
static string chars = "AEIOUBCDFGHJKLMNPQRSTVWXYZ";

static string randomWord(int minlen, int maxlen)
{
    double d1 = minlen + r.NextDouble() * (maxlen - minlen); 
    
    int len = (int)d1;
    
    char[] word = new char[len];
    for (int i = 0; i < len; ++i)
    {
        int index = ((int)Math.Round(25 * r.NextDouble() + 0.4999999999));
        word[i] = chars[index];
    }
    return new string(word);
}

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

    public string Name { get; set; }

    public Item(int id, string name)
    {
        this.Id = id;
        this.Name = name;
    }
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radGridView1.Columns.Clear();
    foreach (DataColumn col in dt.Columns)
    {
        this.radGridView1.Columns.Add(col.ColumnName);
        this.radGridView1.Columns.Last().FieldName = col.ColumnName;
    }
     this.radGridView1.BestFitColumns(BestFitColumnMode.AllCells); 
}

private void Form1_Load(object sender, EventArgs e)
{
    this.radGridView1.AutoGenerateColumns = false;
    this.radGridView1.DataSource = dt; 

    foreach (DataColumn col in dt.Columns)
    {
        this.radGridView1.Columns.Add(col.ColumnName); 
        this.radGridView1.Columns.Last().FieldName = col.ColumnName;
    }
     this.radGridView1.BestFitColumns(BestFitColumnMode.AllCells); 
}

Workaround: clear the GroupDescriptors  collection as well and add the GroupDescriptor programmatically: http://docs.telerik.com/devtools/winforms/gridview/grouping/setting-groups-programmatically
Completed
Last Updated: 30 Nov 2016 07:24 by ADMIN
Note: if you change the image in Windows8 theme for example, the image is successfully applied.

Workaround: set the CurrentRowHeaderImage property at run time.
Unplanned
Last Updated: 02 Sep 2016 12:28 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();
    this.radGridView1.Columns.Add("Name");
    this.radGridView1.Columns.Add("ID");

    this.radGridView1.RowsChanged += radGridView1_RowsChanged;
}

private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)
{
    Console.WriteLine(e.Action);
    if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add)
    {
        GridViewRowInfo row = e.NewItems[0] as GridViewRowInfo;
        row.Cells["ID"].Value = this.radGridView1.Rows.Count;
    }
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radGridView1.Rows.Add("Item" + this.radGridView1.Rows.Count);
}

Note: the first firing of the RowsChanged event used to be with Action=Add.
Completed
Last Updated: 04 Jan 2017 15:58 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Bug Report
0
To reproduce:

public Form1()
{
    InitializeComponent();
    for (int i = 0; i < 10; i++)
    {
        this.radGridView1.Columns.Add("column " + i);
    }

    int charsCount = 5;
    for (int i = 0; i < 20; i++)
    {
        this.radGridView1.Rows.Add(new string('0', charsCount), new string('1', charsCount), 
            new string('2', charsCount), new string('3', charsCount), new string('4', charsCount),
            new string('5', charsCount), new string('6', charsCount), new string('7', charsCount), 
            new string('8', charsCount), new string('9', charsCount));
    }
    HtmlViewDefinition view = new HtmlViewDefinition();
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 0", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 1", 0, 1, 3));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 2", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 3", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 7", 0, 1, 1));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 4", 0, 1, 2));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 5", 0, 2, 1));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 8", 0, 1, 1));
    view.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Column 6", 0, 2, 1));
    view.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Column 9", 0, 1, 1));

    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

    this.radGridView1.ViewDefinition = view;
}

Workaround:
private void radGridView1_SizeChanged(object sender, EventArgs e)
{
    this.radGridView1.MasterTemplate.Refresh();
}

Unplanned
Last Updated: 08 Nov 2016 14:34 by ADMIN
To reproduce: please refer to the attached sample project and gif file. 

Workaround:

private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor;
            if (editor != null)
            {
                RadDateTimeEditorElement el = editor.EditorElement as RadDateTimeEditorElement;
                if (el != null)
                {
                    el.TextBoxElement.TextBoxItem.GotFocus -= TextBoxItem_GotFocus; 
                    el.TextBoxElement.TextBoxItem.GotFocus += TextBoxItem_GotFocus; 
                }
            }
        }

        private void TextBoxItem_GotFocus(object sender, EventArgs e)
        {
            RadTextBoxItem tb = sender as RadTextBoxItem;
            if (tb != null)
            {
                tb.SelectionLength = 0;
            }
        }
Completed
Last Updated: 24 Nov 2016 06:27 by ADMIN
To reproduce:

Sub New()

    InitializeComponent()

    Dim dt As New DataTable()
    dt.Columns.Add("Price", GetType(System.Double))
    dt.Columns.Add("Name", GetType(System.String))
    dt.Columns.Add("Nr", GetType(System.Double))
    For i As Integer = 0 To 49
        dt.Rows.Add(i, "Data" & i, i)
    Next
    With Me.RadGridView1
        .DataSource = dt
        .Columns("Price").FormatString = "{0:C2}"
        .Columns("Nr").FormatString = "{0:N1}"
        .Columns("Price").ExcelExportType = Export.DisplayFormatType.Currency
        '
        .AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
    End With
    Me.RadGridView1.Columns("Price").ExcelExportType = Export.DisplayFormatType.Currency

    Me.RadGridView1.Columns("Nr").ExcelExportType = Export.DisplayFormatType.Custom
    Me.RadGridView1.Columns("Nr").ExcelExportFormatString = "{0:N1}"

    Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill

End Sub

Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
    Dim spreadStreamExport As New GridViewSpreadStreamExport(Me.RadGridView1)
    spreadStreamExport.ExportVisualSettings = True
    Dim fileName As String = "..\..\" + DateTime.Now.ToLongTimeString().Replace(":", "_").ToString() + ".xlsx"
  
    spreadStreamExport.RunExport(fileName, New SpreadStreamExportRenderer())
    Process.Start(fileName)
End Sub

Workaround:
Me.RadGridView1.Columns("Nr").ExcelExportType = Export.DisplayFormatType.Fixed

AddHandler spreadStreamExport.CellFormatting, AddressOf CellFormatting
Private Sub CellFormatting(sender As Object, e As SpreadStreamCellFormattingEventArgs)
        If e.ExportCell.ColumnIndex = 2 Then
            e.ExportCell.ExportFormat = "0.0"
        End If
    End Sub
Completed
Last Updated: 29 Nov 2016 10:37 by ADMIN
Workaround: create a custom RadListFilterPopup
private void radGridView1_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
{
    e.FilterPopup = new MyRadListFilterPopup(e.Column);
}

public class MyRadListFilterPopup : RadListFilterPopup
{
    public MyRadListFilterPopup(GridViewDataColumn dataColumn)
        : base(dataColumn, false)
    { }

    protected override RadListFilterDistinctValuesTable GetDistinctValuesTable()
    {
        if (this.DataColumn.OwnerTemplate.HierarchyLevel == 0)
        {
            return base.GetDistinctValuesTable();    
        }

        GridViewColumnValuesCollection distinctValues = this.GetDistinctValuesWithFilter(this.DataColumn);
        RadListFilterDistinctValuesTable valuesTable = new RadListFilterDistinctValuesTable();
        valuesTable.FormatString = this.DataColumn.FormatString;
        valuesTable.DataConversionInfoProvider = this.DataColumn;

        GridViewComboBoxColumn comboBoxColumn = this.DataColumn as GridViewComboBoxColumn;
        if (comboBoxColumn != null && !String.IsNullOrEmpty(comboBoxColumn.ValueMember))
        {
            foreach (object value in distinctValues)
            {
                if (value != null && value != System.DBNull.Value)
                {
                    object rowValue = value;
                    object lookupValue = ((GridViewComboBoxColumn)this.DataColumn).GetLookupValue(value);

                    if (comboBoxColumn.FilteringMode == GridViewFilteringMode.DisplayMember)
                    {
                        rowValue = lookupValue;
                    }

                    if (lookupValue != null)
                    {
                        valuesTable.Add(lookupValue.ToString(), rowValue);
                    }
                }
            }
        }
        else
        {
            foreach (object value in distinctValues)
            {
                valuesTable.Add(value);
            }
        }

        return valuesTable;
    }

    private GridViewColumnValuesCollection GetDistinctValuesWithFilter(GridViewDataColumn column)
    {
        GridViewColumnValuesCollection distinctValues = new GridViewColumnValuesCollection();
        int count = column.OwnerTemplate.ExcelFilteredColumns.Count;
        if ((count > 0 &&
            column == column.OwnerTemplate.ExcelFilteredColumns[count - 1]) || column.OwnerTemplate.HierarchyLevel > 0)
        {
            if (count == 1 || column.OwnerTemplate.HierarchyLevel > 0)
            {
                int index = column.Index;
                if (index >= 0)
                {
                    IList<GridViewRowInfo> templateRows = column.OwnerTemplate.Rows;
                    if (templateRows.Count == 0 && column.OwnerTemplate.Parent != null && column.OwnerTemplate.HierarchyLevel > 0)
                    {
                        templateRows = new List<GridViewRowInfo>();
                        GridViewInfo templateViewInfo = column.OwnerTemplate.MasterViewInfo;
                        for (int i = 0; i < column.OwnerTemplate.Parent.Rows.Count; i++)
                        {
                            GridViewRowInfo parentRow = column.OwnerTemplate.Parent.Rows[i];
                            ((List<GridViewRowInfo>)templateRows).AddRange(column.OwnerTemplate.HierarchyDataProvider.GetChildRows(parentRow, templateViewInfo));
                        }
                    }
                    
                    foreach (GridViewRowInfo row in templateRows)
                    {
                        object cellValue = row.Cells[index].Value;
                        if (!distinctValues.Contains(cellValue))
                        {
                            distinctValues.Add(cellValue);
                        }
                    }
                    if (distinctValues.Count > 0)
                    {
                        return distinctValues;
                    }
                }
            }
        }

        return distinctValues;
    }
}
Completed
Last Updated: 06 Jan 2017 09:18 by ADMIN
To reproduce:

Sub New()
     
    InitializeComponent()

    Dim dt As New DataTable
    dt.Columns.Add("Id", GetType(Integer))
    dt.Columns.Add("Name", GetType(String))
    dt.Columns.Add("Description", GetType(String))

    For index = 1 To 5
        dt.Rows.Add(index, "Item" & index, "Description" & index)
    Next
    Me.RadGridView1.DataSource = dt
    Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
    
    AddHandler Me.RadGridView1.UserAddingRow, AddressOf UserAddingRow

End Sub

Private Sub UserAddingRow(sender As Object, e As Telerik.WinControls.UI.GridViewRowCancelEventArgs)
    Me.RadGridView1.MasterView.TableAddNewRow.ErrorText = ""
    If String.IsNullOrEmpty(e.Rows(0).Cells(0).Value) Then
        e.Cancel = True
        Me.RadGridView1.MasterView.TableAddNewRow.ErrorText = "Empty value is not allowed!"
    End If
End Sub

1. Click the new row and enter a value in the last cell. 
2. Click outside the new row, e.g. click on a data row. The UserAddingRow event is canceled and the new row remains current. 
3. Click a data row again without any modification on the new row. The new row is not current anymore. 
4. However, you perform step 1and 2 but instead of clicking a data row, the user clicks a header cell, the new row is not current from the first time. It is necessary to forbid the user to exit the new row until the validation passes or the new row is canceled by pressing Enter.

Workaround:  use the CellValidating/RowValidating event for validating.
Declined
Last Updated: 08 Mar 2017 08:26 by ADMIN
Steps to reproduce:

1. Add a CompositeFilterDescriptor programmatically as it is demonstrated in the following help article: http://docs.telerik.com/devtools/winforms/gridview/filtering/setting-filters-programmatically-(composite-descriptors)
2. Save the layout.
3. Load the layout.

Workaround: specify the PropertyName property for the CompositeFilterDescriptor.
Completed
Last Updated: 07 Dec 2016 07:42 by ADMIN
To reproduce:
- Add GridViewTextBoxColumn and set the MaxLength property.
- Paste in data row while the is not in edit mode.

Workaround:
private void RadGridView1_Pasting(object sender, Telerik.WinControls.UI.GridViewClipboardEventArgs e)
{
    if (radGridView1.CurrentColumn.Name == "column1")
    {
        GridViewTextBoxColumn col = new GridViewTextBoxColumn();
        var lenght = col.MaxLength;
        if (Clipboard.ContainsData(DataFormats.Text))
        {
            e.Cancel = true;
            string data = Clipboard.GetData(DataFormats.Text).ToString();
            radGridView1.CurrentCell.Value = data.Substring(0, lenght);
        }
    }
}

 
Completed
Last Updated: 04 Jan 2017 15:58 by ADMIN
When the EnableHeaderCheckBox property is set to true, whenever the checkbox is clicked in the new row, a new row is actually added to the grid before any other modifications are made. This can be replicated in the attached sample project. Run it and click the checkbox in the new row several times. Multiple rows are added.  

Workaround: cancel the RadGridView.UserAddingRow until all the required fields are filled.
Completed
Last Updated: 11 Jan 2017 10:55 by ADMIN
The GridViewCheckBoxColumn.EditMode property controls when the value of the editor will be submitted to the cell. By default, the value is OnValidate and the value will be submitted only when the current cell changes, the grid looses focus or the active editor is closed by pressing Enter. If you set the EditMode property to OnValueChange it will submit the value immediately after the editor value changes. Please refer to the attached gif files illustrating the difference between the two modes.

To reproduce: if you set the GridViewCheckBoxColumn.EnableHeaderCheckBox property to true, the cell value is always submitted immediately after toggle/untoggle the checkbox without considering that EditMode.OnValidate is used.