Completed
Last Updated: 26 Jun 2015 11:08 by ADMIN
To reproduce:

1. Add a RadGridView with two GridViewMultiComboBoxColumns at design time.
2. Bind both of the columns at design time to two different data sources.
3. In the CellEditorInitialized event, set the RadMultiColumnComboBoxElement.AutoSizeDropDownToBestFit property to true.
4. Run the application and open the editor for one of the GridViewMultiComboBoxColumns . You will notice that the columns are automatically sized to fit the content. However, if you open the editor for the other GridViewMultiComboBoxColumn, you will see that columns are not auto sized correctly.  Please refer to the attached gif file.

Workaround:
private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
    RadMultiColumnComboBoxElement mccbEditor = e.ActiveEditor as RadMultiColumnComboBoxElement;
    if (mccbEditor != null)
    {
        mccbEditor.AutoSizeDropDownToBestFit = true;
        mccbEditor.PopupOpening -= mccbEditor_PopupOpening;
        mccbEditor.PopupOpening += mccbEditor_PopupOpening;
    }
}

private void mccbEditor_PopupOpening(object sender, CancelEventArgs e)
{
    RadMultiColumnComboBoxElement mccbEditor = sender as RadMultiColumnComboBoxElement;
    if (mccbEditor != null)
    { 
        mccbEditor.EditorControl.BestFitColumns(BestFitColumnMode.AllCells);
        int width = 0;
        foreach (GridViewColumn c in mccbEditor.EditorControl.Columns)
        {
            width += c.Width;
        }
        width += mccbEditor.EditorControl.TableElement.VScrollBar.Size.Width;
        
        mccbEditor.MultiColumnPopupForm.Size = new Size(width, mccbEditor.MultiColumnPopupForm.Size.Height);
    }
}
Completed
Last Updated: 07 Mar 2014 07:24 by ADMIN
The row's MaxHeight property does not affect the row sizing when the AutoSizeRows property of RadGridView is enabled.

Workaround:
Use the following data row:

public class MyGridDataRowElement : GridDataRowElement
{
protected override Type ThemeEffectiveType
{
get
{
return typeof(GridDataRowElement);
}
}
protected override System.Drawing.SizeF MeasureCore(System.Drawing.SizeF availableSize)
{
float maxHeight = this.RowInfo.MaxHeight;
bool isAutoSize = this.GridViewElement.AutoSize && this.RowInfo.MaxHeight > 0 && availableSize.Height == float.PositiveInfinity;
SizeF size = base.MeasureCore(availableSize);

if (isAutoSize && size.Height > maxHeight)
{
availableSize.Height = maxHeight;
size = base.MeasureCore(availableSize);
}

return size;
}
}

here is how to replace it and set the max height:
void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
{
e.RowElement.RowInfo.MaxHeight = 32;
}

void radGridView1_CreateRow(object sender, GridViewCreateRowEventArgs e)
{
if (e.RowType == typeof(GridDataRowElement))
{
e.RowType = typeof(MyGridDataRowElement);
}
}
Unplanned
Last Updated: 29 Mar 2019 13:48 by ADMIN

How can I enter the Value "" (empty string) in the traditional filter system (not Excel like filter).

The grid does not seem to accept an empty string as an argument to "Equals" through the UI.

Ideally I would like to extend the standard filter menu in traditional filtering (and the filter operator drop down in custom filtering dialog) to contain operators "Is Empty" "Is Not Empty" and "Is Null Or Empty", "Is Not Null And Not Empty"

Regards

Erwin

Completed
Last Updated: 27 Feb 2019 08:40 by ADMIN
To reproduce: please refer to the attached sample project and follow the steps from the attached gif file.

1. Run the project and type "hana" in the second filter cell. You will notice that after a few seconds the input is handled and the grid is filtered.

Workaround: use RadVirtualGrid instead. 
https://docs.telerik.com/devtools/winforms/virtualgrid/overview
https://docs.telerik.com/devtools/winforms/virtualgrid/filtering/filtering

Second workaround: https://docs.telerik.com/devtools/winforms/gridview/filtering/how-to/filter-on-enter
Completed
Last Updated: 10 Sep 2015 13:14 by Jesse Dyck
The performance of excel-like filtering when you have more than 5000+ row in RadGridView.
Completed
Last Updated: 20 Oct 2016 13:06 by Irene
Currently, if there are not enough rows to fill the height of RadGridView control, the pinned row will appear right after the last row. It will be good to facilitate customization that sets the pinned row to appear at the bottom of the grid. Same logic holds for summary rows and columns.

Workaround:

public Form1()
{
    InitializeComponent();

    DataTable dt = new DataTable();
    dt.Columns.Add("Id");
    dt.Columns.Add("Name");
    for (int i = 0; i < 5; i++)
    {
        dt.Rows.Add(i, "Item" + i);
    }

    this.radGridView1.DataSource = dt;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

    this.radGridView1.AllowSearchRow = true;
    this.radGridView1.SearchRowPosition = Telerik.WinControls.UI.SystemRowPosition.Bottom;

    this.radGridView1.ViewDefinition = new CustomTableViewDefition();
}

public class CustomTableViewDefition : TableViewDefinition
{
    public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
    {
        return new CustomTableElement();
    }
}

public class CustomTableElement : GridTableElement
{
    protected override RowsContainerElement CreateViewElement()
    {
        return new CustomRowsContainerElement();
    }
}

public class CustomRowsContainerElement : RowsContainerElement
{
    protected override SizeF ArrangeOverride(SizeF finalSize)
    {
        float y = 0;

        this.TopPinnedRows.Arrange(new RectangleF(0, y, finalSize.Width, this.TopPinnedRows.DesiredSize.Height));
        y += this.TopPinnedRows.DesiredSize.Height + ElementSpacing;

        this.ScrollableRows.Arrange(new RectangleF(0, y, finalSize.Width, this.ScrollableRows.DesiredSize.Height));
        y += this.ScrollableRows.DesiredSize.Height + ElementSpacing;

        this.BottomPinnedRows.Arrange(new RectangleF(0, finalSize.Height - this.BottomPinnedRows.DesiredSize.Height,
            finalSize.Width, this.BottomPinnedRows.DesiredSize.Height));

        return finalSize;
    }
}
Completed
Last Updated: 15 Aug 2017 10:29 by ADMIN
To reproduce:
        public Form1()
        {
            InitializeComponent();
            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("ParentId", typeof(int));

            for (int i = 0; i < 3; i++)
            {
                dt.Rows.Add(i, "Parent" + i, -1);
            }
            Random rand = new Random();
            for (int i = 3; i < 15; i++)
            {
                dt.Rows.Add(i,"Child"+i,rand.Next(0,3));
            }

            this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId");
            this.radGridView1.DataSource = dt;
            this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            this.radGridView1.EnableGrouping = true;
            this.radGridView1.EnableCustomGrouping = true;
            this.radGridView1.CustomGrouping+=radGridView1_CustomGrouping;
         }

private void radGridView1_CustomGrouping(object sender, GridViewCustomGroupingEventArgs e)
{
     
}
Completed
Last Updated: 18 Oct 2016 10:19 by ADMIN
To reproduce:
DataTable table;
public RadForm1()
{
    InitializeComponent();
    table = GetTable();
    radGridView1.DataSource = table;

}

private void radButton1_Click(object sender, EventArgs e)
{
    var changes = table.GetChanges();

    if (changes == null)
    {
        Console.WriteLine("No Changes");
    }
    else
    {
        Console.WriteLine("Saved");

        foreach (DataRow item in changes.Rows) 
        {
            Console.WriteLine(item.RowState.ToString());
        }
    }

    table.AcceptChanges();
}
static DataTable GetTable()
{

    DataTable table = new DataTable();
    table.Columns.Add("Dosage", typeof(int));
    table.Columns.Add("Drug", typeof(string));
    table.Columns.Add("Name", typeof(string));
    table.Columns.Add("Date", typeof(DateTime));


    table.Rows.Add(25, "Indocin", "David", DateTime.Now);
    table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
    table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
    table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
    table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
    table.AcceptChanges();

    return table;
}

Workaround:
(this.radGridView1.CurrentRow.DataBoundItem as IEditableObject).EndEdit();
Completed
Last Updated: 17 Jun 2015 11:38 by ADMIN
Presently it is not possible to persist customer created formatting objects in RadGridView.
Declined
Last Updated: 05 Jun 2015 08:32 by ADMIN
To reproduce:
void radGridView1_CurrentRowChanged(object sender, Telerik.WinControls.UI.CurrentRowChangedEventArgs e)
        {
            e.CurrentRow.Cells[2].ColumnInfo.IsCurrent = true;
        }
Completed
Last Updated: 09 Jun 2015 06:45 by ADMIN
ADD. RadGridView - add the ability to group by a certain column and display the groups sorted by the values of another column
Completed
Last Updated: 21 May 2015 09:19 by ADMIN
If you set the MinWidth and MaxWidth to a column and then set AutoSizeColumnMode to Fill (all this in the form constructor) a gap will appear between the columns.

Workaround: set the Fill before the MinWidth and MaxWidth and to do all these operations on Load.
Completed
Last Updated: 07 Jul 2020 08:23 by ADMIN
Release R3 2020 (LIB 2020.2.713)

Hello,

We are experiencing a strange behaviour of RadGridView set as a self referencing hierarchy when used with Excel filters.

Once we use predefined filter values (both, build-in and custom defined by us) the filter icon is highlitghted when none of the filter is marked. This higlight can be removed when clear filters button of filter popup is used or FilterDescriptors are cleared. If we do not clear the filters manually, and, for instance, sort grid column the application crashes with internal error of the grid. Error reads Object reference not set to an instance of object.

Attached movie will explain it better. I have also attached a ver simple sample project with data (which does not make sense, just for visualisation) that should fail when you repeat steps described above (turn today or last 7 days filter, apply, select no filter, apply and try to sort the same column).

Is there a workaround or specific conditions we need to apply to have it working?

Thanks for your advice.

I'm also attaching errors details:

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of object. /this message comes in Polish, translated
  Source=Telerik.WinControls.GridView
  StackTrace:
   at Telerik.WinControls.UI.GridViewTemplate.PerformHierarchyFilter(GridViewRowInfo rowInfo)
   at Telerik.WinControls.Data.RadCollectionView`1.PassesFilter(TDataItem item)
   at Telerik.Collections.Generic.HybridIndex`1.GetFilteredItems(IEnumerable`1 e)
   at Telerik.Collections.Generic.HybridIndex`1.PerformWithQuickSort()
   at Telerik.Collections.Generic.HybridIndex`1.Perform()
   at Telerik.Collections.Generic.HybridIndex`1.get_Items()
   at Telerik.Collections.Generic.Index`1.get_Count()
   at Telerik.WinControls.Data.GroupBuilder`1.get_Groups()
   at Telerik.WinControls.Data.SnapshotCollectionView`1.get_Groups()
   at Telerik.WinControls.UI.GridViewInfo.LoadHierarchicalData(GridViewHierarchyRowInfo parent, ICollectionView`1 sourceView)
   at Telerik.WinControls.UI.GridViewInfo.Refresh()
   at Telerik.WinControls.UI.GridViewInfo.get_ChildRows()
   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.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI)
   at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(GridViewEvent gridEvent, 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.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify)
   at Telerik.WinControls.Data.RadDataView`1.RefreshOverride()
   at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName)
   at Telerik.WinControls.Data.RadCollectionView`1.sortDescriptors_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Collections.Generic.NotifyCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.UI.GridViewSortDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Collections.Generic.NotifyCollection`1.InsertItem(Int32 index, T item)
   at Telerik.WinControls.Data.SortDescriptorCollection.InsertItem(Int32 index, SortDescriptor item)
   at Telerik.WinControls.UI.GridViewSortDescriptorCollection.InsertItem(Int32 index, SortDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   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 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at Telerik.WinControls.UI.RadGridView.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at bindingListEx_celLike.My.MyApplication.Main(String[] Args) in :line 81

Unplanned
Last Updated: 15 Aug 2017 09:33 by Uwe
Consider the iTunes Artist mode grid
http://www.telerik.com/forums/itunes-like-grid
Unplanned
Last Updated: 14 May 2019 06:18 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 1
Category: GridView
Type: Bug Report
4
To reproduce:
Add a RadGridView and use the following code. When you expand the first row, the vertical scrollbar is not correct. Scrolling down changes its size. However, if you expand the last row, it takes few seconds to open.

Second scenario:
In addition of the following code, if you change the TableElement.PageViewMode to PageViewMode.ExplorerBar, expanding the first row takes few seconds to load the hierarchical data as well.

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        List<Item> items = new List<Item>();
        List<SubItem> subItems = new List<SubItem>();

        for (int i = 1; i <= 3; i++)
        {
            Item item = new Item(i, "Item" + i);
            
            for (int j = 1000; j <= 2010; j++)
            {
                subItems.Add(new SubItem(j, "SubItem" + j, i));
            }

            items.Add(item);
        }

        this.radGridView1.DataSource = items;
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

        GridViewTemplate template = new GridViewTemplate();
        template.ReadOnly = true;
        template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

        GridViewRelation relation = new GridViewRelation(this.radGridView1.MasterTemplate, template);
        relation.ParentColumnNames.Add("Id");
        relation.ChildColumnNames.Add("ItemId");
        this.radGridView1.MasterTemplate.Templates.Add(template);
        this.radGridView1.Relations.Add(relation);
        template.DataSource = subItems;
    }
}

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

    public string Title { get; set; }

    public Item(int id, string title)
    {
        this.Id = id;
        this.Title = title;
    }
}

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

    public int ItemId { get; set; }

    public string Name { get; set; }
    
    public SubItem(int id, string name, int itemId)
    {
        this.Id = id;
        this.ItemId = itemId;
        this.Name = name;
    }
}
Unplanned
Last Updated: 13 Nov 2024 14:49 by ADMIN
Improve the sorting performance when having equal values in the column.
Completed
Last Updated: 02 Jan 2013 03:08 by ADMIN
Steps to reproduce:
1. Use the RadGridView Smart Tag to set its data source 
2. Press "Add Project DataSource"
3. Select "Object"
4. Drill down and select the class you created. (see below)
5. Select the New Data Source
6. Run the project 

Code to reproduce:

public class TestClass
{
public enum Month { January, Febuary, March, April, May, June, July, August, September, October, November, December }
public Month TestMonth {get; set;}
public String TestMessage {get; set;}
public TestClass(Month month, String message)
{
TestMonth = month; TestMessage = message; }
}

Workaround:
Use BindingList instead System.Windows.Forms.BindingSource.
Unplanned
Last Updated: 26 Mar 2018 11:38 by ADMIN
Use attached project to reproduce!

Another case is when the font size is changed from the settings dialog - in this case, the row height is not adjusted.

Workaround:
Use the following custom print style:

class MyTableViewDefinitionPrintRenderer : TableViewDefinitionPrintRenderer
{
    public MyTableViewDefinitionPrintRenderer(RadGridView grid) : base(grid)
    {

    }
    protected override int GetDataRowHeight(GridViewRowInfo row, TableViewRowLayoutBase rowLayout)
    {
        int result = base.GetDataRowHeight(row, rowLayout);

        int newHeight = 0;

        if (!(row is GridViewGroupRowInfo))
        {
            foreach (GridViewColumn col in row.ViewTemplate.Columns)
            {
                if (col is GridViewRowHeaderColumn || col is GridViewIndentColumn || !col.IsVisible)
                {
                    continue;
                }

                string value = row.Cells[col.Name].Value.ToString();

                TableViewCellArrangeInfo info = ((TableViewRowLayout)rowLayout).LayoutImpl.GetArrangeInfo(col);
                float cellWidth = (float)info.CachedWidth;
                int currentHeight = TextRenderer.MeasureText(value, this.GridView.PrintStyle.CellFont, new Size((int)cellWidth, 0), TextFormatFlags.WordBreak).Height + this.GridView.Font.Height *4;

                newHeight = Math.Max(newHeight, currentHeight);

            }
        }


        return Math.Max(newHeight, result); 
    }
}
class MyPrintStyle :GridPrintStyle
{
    protected override BaseGridPrintRenderer InitializePrintRenderer(RadGridView grid)
    {
        return new MyTableViewDefinitionPrintRenderer(grid);
    }
}
Unplanned
Last Updated: 19 Mar 2019 10:29 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 2
Category: GridView
Type: Bug Report
4
To reproduce: use the following code snippet, save the layout and load it afterwards. You will notice that only the master and the first child template are successfully loaded.

public Form1()
{
    InitializeComponent();
    DataTable dt = new DataTable();
    dt.Columns.Add("Id", typeof(int));
    dt.Columns.Add("Name", typeof(string));
    for (int i = 0; i < 5; i++)
    {
        dt.Rows.Add(i, "Parent" + i);
    }

    this.radGridView1.MasterTemplate.DataSource = dt;
    this.radGridView1.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

    //child level 1
    GridViewTemplate template = new GridViewTemplate();
    template.DataSource = GetData(5, 20, 0, 5);
    template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    radGridView1.MasterTemplate.Templates.Add(template);

    GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate);
    relation.ChildTemplate = template;
    relation.RelationName = "ParentChild";
    relation.ParentColumnNames.Add("Id");
    relation.ChildColumnNames.Add("ParentId");
    radGridView1.Relations.Add(relation);

    //child level 2
    GridViewTemplate template2 = new GridViewTemplate();
    template2.DataSource = GetData(20, 40, 5, 20);
    template2.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    template.Templates.Add(template2);

    GridViewRelation relation2 = new GridViewRelation(template);
    relation2.ChildTemplate = template2;
    relation2.RelationName = "ParentChild";
    relation2.ParentColumnNames.Add("Id");
    relation2.ChildColumnNames.Add("ParentId");
    radGridView1.Relations.Add(relation2);

    //child level 3
    GridViewTemplate template3 = new GridViewTemplate();
    template3.DataSource = GetData(40, 100, 20, 40);
    template3.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    template2.Templates.Add(template3);

    GridViewRelation relation3 = new GridViewRelation(template2);
    relation3.ChildTemplate = template3;
    relation3.RelationName = "ParentChild";
    relation3.ParentColumnNames.Add("Id");
    relation3.ChildColumnNames.Add("ParentId");
    radGridView1.Relations.Add(relation3);

    //child level 4
    GridViewTemplate template4 = new GridViewTemplate();
    template4.DataSource = GetData(100, 200, 40, 100);
    template4.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    template3.Templates.Add(template4);

    GridViewRelation relation4 = new GridViewRelation(template3);
    relation4.ChildTemplate = template4;
    relation4.RelationName = "ParentChild";
    relation4.ParentColumnNames.Add("Id");
    relation4.ChildColumnNames.Add("ParentId");
    radGridView1.Relations.Add(relation4);
}

private object GetData(int from, int to, int parentFrom, int parentTo)
{
    DataTable dt = new DataTable();
    dt.Columns.Add("Id", typeof(int));
    dt.Columns.Add("Name", typeof(string));  
    dt.Columns.Add("ParentId", typeof(int));
    Random rand = new Random();
    for (int i = from; i < to; i++)
    {
        dt.Rows.Add(i, "Child" + i, rand.Next(parentFrom, parentTo));
    }
    return dt;
}

private void radButton1_Click(object sender, EventArgs e)
{
    string s = "default.xml";
    SaveFileDialog dialog = new SaveFileDialog();
    dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
    dialog.Title = "Select a xml file";
    if (dialog.ShowDialog() == DialogResult.OK)
    {
        s = dialog.FileName;
    }
    this.radGridView1.SaveLayout(s);
}

private void radButton2_Click(object sender, EventArgs e)
{
    string s = "default.xml";
    OpenFileDialog dialog = new OpenFileDialog();
    dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
    dialog.Title = "Select a xml file";
    if (dialog.ShowDialog() == DialogResult.OK)
    {
        s = dialog.FileName;
    }
    this.radGridView1.LoadLayout(s);
}


Workaround: grid templates for the inner levels are recreated after loading the layout. Their DataSource is null and the existing relations points to the old templates. Clear the relations and setup them again with the new  child template instances.
Duplicated
Last Updated: 12 May 2021 12:28 by ADMIN
Steps to reproduce:

1. Create a form
2. Set its Localization property to true.
3. Add RadGridView to the form
4. Add 3 GridViewTextBoxColumn instances at design-time
5. Change the Language of the form to Polish
6. The variable names of the columns are changed (gridViewTextBoxColumn1 to gridViewTextBoxColumn4, gridViewTextBoxColumn2 to gridViewTextBoxColumn5, gridViewTextBoxColumn3 to gridViewTextBoxColumn6)