Completed
Last Updated: 07 Nov 2016 11:49 by ADMIN
Workaround: custom CompositeFilterForm 
private void radGridView1_CreateCompositeFilterDialog(object sender, GridViewCreateCompositeFilterDialogEventArgs e)
{
    e.Dialog = new MyCompositeFilterForm();
}

public class MyCompositeFilterForm : CompositeFilterForm
{
    public override void Initialize(GridViewDataColumn dataColumn, Telerik.WinControls.Data.FilterDescriptor filterDescriptor, bool useTypedEditors)
    {
        base.Initialize(dataColumn, filterDescriptor, useTypedEditors);

        if (dataColumn.Name == "Time")
        {
            RadDateTimePicker rEditor = (RadDateTimePicker)this.RightEditor;
            rEditor.DateTimePickerElement.ShowTimePicker = true;
            rEditor.DateTimePickerElement.CalendarSize = new Size(500, 250);

            RadDateTimePicker lEditor = (RadDateTimePicker)this.LeftEditor;
            lEditor.DateTimePickerElement.ShowTimePicker = true;
            lEditor.DateTimePickerElement.CalendarSize = new Size(500, 250);
        }
    }

protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
    base.OnClosing(e);

    if (this.DialogResult == DialogResult.OK)
    {
        object leftValue = this.GetValueFromDateEditor(this.LeftEditor);
        if (leftValue != null)
        {
            this.LeftDescriptor.Value = leftValue;
        }

        object rightValue = this.GetValueFromDateEditor(this.RightEditor);
        if (rightValue != null)
        {
            this.RightDescriptor.Value = rightValue;
        }
    }
}


    protected virtual object GetValueFromDateEditor(RadControl editorControl)
    {
        object value = null;
        if (editorControl is RadDateTimePicker)
        {
            value = ((RadDateTimePicker)editorControl).Value;
            return value;
        }

        return value;
    }
}

Completed
Last Updated: 24 Oct 2016 08:55 by ADMIN
The issue can be reproduced with the .40 version of the assemblies and in a scenario in which the grid is added as a RadMenuHostItem to the Items collection of a drop-down button.

Workaround:  set the BindingContext of the grid to equal that of the form: 
public Form1()
{
            InitializeComponent();

            radGridView1.BindingContext = this.BindingContext;
}
Completed
Last Updated: 20 Oct 2016 15:46 by ADMIN
To reproduce:
public Form1()
{
    InitializeComponent();
    
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text1"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text2"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text3"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text4"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text5"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text6"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text7"));
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Text8"));
    radGridView1.Columns.Add(new GridViewDateTimeColumn("Date1"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount1"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount2"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount3"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount4"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount5"));
    radGridView1.Columns.Add(new GridViewDecimalColumn("Amount6"));
    radGridView1.DataSource = GetDataSet();
}

private DataTable GetDataSet()
{
    DataTable dt = new DataTable();
    dt.Columns.Add(new DataColumn("Text1", typeof(string)));
    dt.Columns.Add(new DataColumn("Text2", typeof(string)));
    dt.Columns.Add(new DataColumn("Text3", typeof(string)));
    dt.Columns.Add(new DataColumn("Text4", typeof(string)));
    dt.Columns.Add(new DataColumn("Text5", typeof(string)));
    dt.Columns.Add(new DataColumn("Text6", typeof(string)));
    dt.Columns.Add(new DataColumn("Text7", typeof(string)));
    dt.Columns.Add(new DataColumn("Text8", typeof(string)));
    dt.Columns.Add(new DataColumn("Date1", typeof(DateTime)));
    dt.Columns.Add(new DataColumn("Amount1", typeof(decimal)));
    dt.Columns.Add(new DataColumn("Amount2", typeof(decimal)));
    dt.Columns.Add(new DataColumn("Amount3", typeof(decimal)));
    dt.Columns.Add(new DataColumn("Amount4", typeof(decimal)));
    dt.Columns.Add(new DataColumn("Amount5", typeof(decimal)));
    dt.Columns.Add(new DataColumn("Amount6", typeof(decimal)));

    for (int i = 1; i <= 150000; i++)
    {
        dt.Rows.Add(new object[]
        {
            "Example Text For Row " + i.ToString(),
            "Example Text For Row " + i.ToString(),
            "More Example Text For Row " + i.ToString(),
            "Even More Example Text For Row " + i.ToString(),
            "Lots More Example Text For Row " + i.ToString(),
            "Excessive Example Text For Row " + i.ToString(),
            "Extra Example Text For Row " + i.ToString(),
            "Random Example Text For Row " + i.ToString(),
            new DateTime(2015, i % 12 + 1, i % 28 + 1),
            i % 2 * 10000, i % 3 * 10000, i % 5 * 10000, i % 7 * 10000, i % 11 * 10000, i % 13 * 10000
        });
    }

    return dt;
}

string fileName = @"..\..\" + DateTime.Now.ToLongTimeString().Replace(":", "_");

private void button1_Click(object sender, EventArgs e)
{
    SaveFileDialog sfdExportToExcel = new SaveFileDialog();
    DialogResult exportBrowse = sfdExportToExcel.ShowDialog();

    if (exportBrowse == DialogResult.OK)
    {
        GridViewSpreadExport exporter = new GridViewSpreadExport(this.radGridView1);
        exporter.SheetMaxRows = Telerik.WinControls.UI.Export.ExcelMaxRows._1048576;
        exporter.FileExportMode = FileExportMode.CreateOrOverrideFile;
        exporter.ExportVisualSettings = false;
        exporter.AsyncExportCompleted += exporter_AsyncExportCompleted;
        SpreadExportRenderer renderer = new SpreadExportRenderer();
        
        exporter.RunExportAsync(fileName, renderer);
    }
}

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: 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: 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: 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: 10 Oct 2016 08:24 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 6
Category: GridView
Type: Bug Report
2
Workaround: skip the summary rows by creating custom GridViewSearchRowInfo:  

private void radGridView1_CreateRowInfo(object sender, GridViewCreateRowInfoEventArgs e)
{
    if (e.RowInfo is GridViewSearchRowInfo)
    {
        e.RowInfo = new CustomGridViewSearchRowInfo(e.ViewInfo);
    }
}


public class CustomGridViewSearchRowInfo : GridViewSearchRowInfo
        {
            public CustomGridViewSearchRowInfo(GridViewInfo viewInfo) : base(viewInfo)
            {
            }

            protected override bool MatchesSearchCriteria(string searchCriteria, GridViewRowInfo row, GridViewColumn col)
            {
                if (row is GridViewSummaryRowInfo)
                {
                    return false;
                }
                return base.MatchesSearchCriteria(searchCriteria, row, col);
            }
        }
Completed
Last Updated: 05 Oct 2016 14:00 by ADMIN
Workaround: 

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

            this.radGridView1.DataSource = this.GetData();
            this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

            ((GridViewDateTimeColumn)this.radGridView1.Columns["Date"]).FormatString = "{0: yyyy-MM-dd hh:mm:ss.fff tt}";
        }

        private DataTable GetData()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Date", typeof(DateTime));
            dt.Columns.Add("Bool", typeof(bool));
            for (int i = 0; i < 100; i++)
            {
                dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
            }

            return dt;
        }
    }

 public class MyRadGridView : RadGridView
    {
        public override string ThemeClassName
        {
            get
            {
                return typeof(RadGridView).FullName;
            }
        }

        protected override RadGridViewElement CreateGridViewElement()
        {
            return new MyRadGridViewElement();
        }
    }

 public class MyRadGridViewElement : RadGridViewElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(MyRadGridViewElement);
            }
        }

        protected override MasterGridViewTemplate CreateTemplate()
        {
            return new MyMasterGridViewTemplate();
        }
    }

 public class MyMasterGridViewTemplate : MasterGridViewTemplate
    {
        public override void Copy()
        {
            base.Copy();

            GridViewCellInfo[] cells = null;
            if (this.SelectionMode == GridViewSelectionMode.CellSelect)
            {
                cells = new GridViewCellInfo[this.SelectedCells.Count];
                this.SelectedCells.CopyTo(cells, 0);
            }
            else if (this.SelectionMode == GridViewSelectionMode.FullRowSelect)
            {
                GridViewDataRowInfo row = this.SelectedRows[0] as GridViewDataRowInfo;
                if (this.SelectedRows.Count == 1 && row.ViewTemplate.CurrentColumn != null)
                {
                    cells = new GridViewCellInfo[row.Cells.Count];
                    for (int i = 0; i < row.Cells.Count; i++)
                    {
                        cells[i] = row.Cells[i];
                    }
                }
            }

            if (Clipboard.GetData(DataFormats.Text) != null)
            {
                string data = Clipboard.GetData(DataFormats.Text).ToString();
                if (data != string.Empty && cells != null)
                {
                    var values = data.Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);

                    StringBuilder sb = new StringBuilder();
                    foreach (string value in values)
                    {
                        DateTime date;
                        if (DateTime.TryParse(value, out date))
                        {
                            string baseFormat = "yyyy-MM-dd HH:mm tt";
                            foreach (var cell in cells)
                            {
                                if (cell.ColumnInfo is GridViewDateTimeColumn && ((DateTime)cell.Value).ToString(baseFormat) == date.ToString(baseFormat))
                                {
                                    sb.Append(string.Format(((GridViewDateTimeColumn)cell.ColumnInfo).FormatString, cell.Value) + "\t");
                                    break;
                                }
                            }
                        }
                        else
                        {
                            sb.Append(value + "\t");
                        }
                    }

                    Clipboard.Clear();
                    Clipboard.SetData(DataFormats.Text, sb.ToString());
                }
            }
        }
    }
Completed
Last Updated: 05 Oct 2016 10:38 by ADMIN
To reproduce: follow the steps illustrated in the attached gif file.
Completed
Last Updated: 04 Oct 2016 08:22 by ADMIN
Please refer to the attached screenshot.

To reproduce:

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, "Item" + i);
    }

    Random rand = new Random();
    DataTable dt2 = new DataTable();
    dt2.Columns.Add("Id", typeof(int));
    dt2.Columns.Add("Name2", typeof(string));
    dt2.Columns.Add("ParentId", typeof(int));
    for (int i = 0; i < 20; i++)
    {
        dt2.Rows.Add(i, "Child Item" + i, rand.Next(0, 5));
    }

    radGridView1.DataSource = dt;
    radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    GridViewTemplate template = new GridViewTemplate();
    template.DataSource = dt2;
    template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    radGridView1.MasterTemplate.Templates.Add(template);
    template.Columns["ParentId"].IsVisible = false;

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

    this.radGridView1.EnableFiltering = true;
    this.radGridView1.ShowFilteringRow = false;
    this.radGridView1.ShowHeaderCellButtons = true;
}

Workaround: change the Name property of the column in order to avoid duplicated columns: 

template.Columns["Name"].Name = "Name2";
Unplanned
Last Updated: 04 Oct 2016 08:20 by ADMIN
To reproduce: please refer to the attached gif file demonstrating how to reproduce the issue with the Demo application.

Workaround: use the basic filtering.
Unplanned
Last Updated: 04 Oct 2016 06:27 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Feature Request
3
Repeat the master template headers right after the end of an expanded detail template. The purpose is clarity for the end user.
Completed
Last Updated: 28 Sep 2016 06:40 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();
    List<Item> items = new List<Item>();
    for (int i = 0; i < 10; i++)
    {
        items.Add(new Item(i,"Item" + i,Color.Red));
    }
    this.radGridView1.DataSource = items;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.CellValidating += radGridView1_CellValidating;
}

private void radGridView1_CellValidating(object sender, Telerik.WinControls.UI.CellValidatingEventArgs e)
{
    if (e.ActiveEditor != null && e.ActiveEditor is GridColorPickerEditor)
    {
        Color c = (Color)e.Value;
        if (c == Color.Red)
        {
            e.Cancel = true;
            Console.WriteLine("Red is not allowed!");
        }
    }
}

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

    public string Name { get; set; }

    public Color Color { get; set; }

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

Steps:
1. Activate the editor for the Color cell.
2. Leave the color as it
3. Press the Enter key. The CellValidating event is fired twice.

Note: it seems that when the color text is selected, the event is fired twice.

Declined
Last Updated: 27 Sep 2016 07:28 by ADMIN
Please refer to the attached screenshot.

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

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: 20 Sep 2016 06:41 by ADMIN
To reproduce:

 public RadForm1()
 {
     InitializeComponent();
     
     DataTable master = new DataTable();
     master.Columns.Add("ID", typeof(int));
     master.Columns.Add("test", typeof(string));
     
     for (int i = 0; i < 500; i++)
     {
         master.Rows.Add(i, "Row " + i);
     }

     radGridView1.DataSource = master;

     radLabel1.Text = "RadGridView: AutoSizeRows = " + ((radGridView1.AutoSizeRows) ? "True" : "False");
 }

 private void radButton1_Click(object sender, EventArgs e)
 {
     radGridView1.TableElement.ScrollToRow(radGridView1.MasterTemplate.Rows[200]);
 }

 private void radButton2_Click(object sender, EventArgs e)
 {
     radGridView1.AutoSizeRows = !radGridView1.AutoSizeRows;

     radLabel1.Text = "RadGridView: AutoSizeRows = " + ((radGridView1.AutoSizeRows) ? "True" : "False");
 }


Workaround:

this.radGridView1.ViewDefinition = new CustomTableViewDefinition();


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

        public class CustomGridTableElement : GridTableElement
        {
              protected override Type ThemeEffectiveType     
                 { 
                    get    
                              { 
                                     return typeof(GridTableElement);     
                               }
                   }
            public override void ScrollToRow(GridViewRowInfo rowInfo)
            {
                if (rowInfo == null || rowInfo.IsPinned || !rowInfo.IsVisible || rowInfo is GridViewDetailsRowInfo)
                {
                    return;
                }

                this.ViewElement.InvalidateMeasure();
                this.ViewElement.UpdateLayout();

                if (GridViewElement.AutoSizeRows || (ViewTemplate.Templates.Count > 0 && rowInfo.ViewTemplate.Parent != null))
                {
                    ScrollToRowCore(rowInfo, false);

                    return;
                }

                this.RowScroller.ScrollToItem(rowInfo, false);
                this.UpdateLayout();
            }

            private void ScrollToRowCore(GridViewRowInfo rowInfo, bool ensureVisible)
            {
                if (!this.GridViewElement.UseScrollbarsInHierarchy && this.ViewInfo.ParentRow != null)
                {
                    if (ensureVisible)
                    {
                        this.GridViewElement.TableElement.EnsureRowVisible(rowInfo);
                    }
                    else
                    {
                        this.GridViewElement.TableElement.ScrollToRow(rowInfo);
                    }
                    return;
                }

                if (!this.IsInValidState(true) || this.VScrollBar.LargeChange == 0)
                {
                    return;
                }

                RadControl control = this.ElementTree.Control as RadControl;
                if (control != null)
                {
                    control.SuspendUpdate();
                }

                int oldValue = this.VScrollBar.Value;
                GridRowElement rowElement = GetChildRowElement(rowInfo);
                
                if (rowElement == null && this.PageViewMode == PageViewMode.ExplorerBar)
                {
                    if (control != null)
                    {
                        control.ResumeUpdate();
                    }

                    return;
                }

                while (this.VScrollBar.Value < this.VScrollBar.Maximum)
                {
                    if (rowElement == null)
                    {
                        rowElement = GetChildRowElement(rowInfo);
                    }
                    if (rowElement != null)
                    {
                        ScrollToPartiallyVisibleRow(rowElement, ensureVisible);
                        break;
                    }
                    else
                    {
                        bool scrollRangeChanged = SetScrollValue(this.VScrollBar, this.VScrollBar.Value + this.VScrollBar.SmallChange);
                        if (this.VScrollBar.Value >= this.VScrollBar.Maximum - this.VScrollBar.LargeChange + 1 && !scrollRangeChanged)
                        {
                            SetScrollValue(this.VScrollBar, oldValue);
                            break;
                        }
                    }
                }

                if (oldValue == this.VScrollBar.Minimum || rowElement != null)
                {
                    if (control != null)
                    {
                        control.ResumeUpdate();
                    }
                    return;
                }

                SetScrollValue(this.VScrollBar, 0);

                while (this.VScrollBar.Value < oldValue)
                {
                    if (rowElement == null)
                    {
                        rowElement = GetChildRowElement(rowInfo);
                    }
                    if (rowElement != null)
                    {
                        ScrollToPartiallyVisibleRow(rowElement, ensureVisible);
                        break;
                    }
                    else
                    {
                        bool scrollRangeChanged = SetScrollValue(this.VScrollBar, this.VScrollBar.Value + this.VScrollBar.SmallChange);
                        if (this.VScrollBar.Value >= this.VScrollBar.Maximum - this.VScrollBar.LargeChange + 1 && !scrollRangeChanged)
                        {
                            SetScrollValue(this.VScrollBar, oldValue);
                            break;
                        }
                    }
                }

                if (control != null)
                {
                    control.ResumeUpdate();
                }
            }

            private GridRowElement GetChildRowElement(GridViewRowInfo rowInfo)
            {
                if (rowInfo.ViewInfo == this.ViewInfo)
                {
                    return GetRowElement(rowInfo);
                }
                else
                {
                    GridTableElement tableElement = GridViewElement.GetRowView(rowInfo.ViewInfo) as GridTableElement;
                    if (tableElement != null)
                    {
                        return tableElement.GetRowElement(rowInfo);
                    }
                }
                return null;
            }

            private void ScrollToPartiallyVisibleRow(GridRowElement rowElement, bool ensureVisible)
            {
                int delta = 0;

                while ((rowElement.ControlBoundingRectangle.Y < ViewElement.ScrollableRows.ControlBoundingRectangle.Y &&
                        rowElement.ControlBoundingRectangle.Bottom > ViewElement.ScrollableRows.ControlBoundingRectangle.Y) ||
                       (rowElement.ControlBoundingRectangle.Y < ViewElement.ScrollableRows.ControlBoundingRectangle.Bottom &&
                        rowElement.ControlBoundingRectangle.Bottom > ViewElement.ScrollableRows.ControlBoundingRectangle.Bottom))
                {
                    if (rowElement.ControlBoundingRectangle.Y < ViewElement.ScrollableRows.ControlBoundingRectangle.Y &&
                        rowElement.ControlBoundingRectangle.Bottom > ViewElement.ScrollableRows.ControlBoundingRectangle.Y)
                    {
                        delta = ViewElement.ScrollableRows.ControlBoundingRectangle.Y - rowElement.ControlBoundingRectangle.Y;
                        SetScrollValue(this.VScrollBar, this.VScrollBar.Value - delta);

                        return;
                    }

                    if (rowElement.ControlBoundingRectangle.Y < ViewElement.ScrollableRows.ControlBoundingRectangle.Bottom &&
                        rowElement.ControlBoundingRectangle.Bottom > ViewElement.ScrollableRows.ControlBoundingRectangle.Bottom)
                    {
                        delta = rowElement.ControlBoundingRectangle.Top - ViewElement.ScrollableRows.ControlBoundingRectangle.Top;
                        SetScrollValue(this.VScrollBar, this.VScrollBar.Value + delta);

                        return;
                    }

                    if (ensureVisible)
                    {
                        delta = rowElement.ControlBoundingRectangle.Bottom - ViewElement.ScrollableRows.ControlBoundingRectangle.Bottom;

                        if (delta < 0)
                        {
                            break;
                        }
                    }
                    else
                    {
                        delta = rowElement.ControlBoundingRectangle.Y - ViewElement.ScrollableRows.ControlBoundingRectangle.Y;

                        if (delta < 0)
                        {
                            delta = 0;
                        }
                    }

                    bool scrollRangeChanged = SetScrollValue(this.VScrollBar, this.VScrollBar.Value + delta);

                    if (this.VScrollBar.Value >= this.VScrollBar.Maximum - this.VScrollBar.LargeChange + 1 || !scrollRangeChanged)
                    {
                        break;
                    }
                }
            }
            
            private bool SetScrollValue(RadScrollBarElement scrollbar, int newValue)
            {
                int max = this.VScrollBar.Maximum;

                if (newValue > scrollbar.Maximum - scrollbar.LargeChange + 1)
                {
                    newValue = scrollbar.Maximum - scrollbar.LargeChange + 1;
                }

                if (newValue < scrollbar.Minimum)
                {
                    newValue = scrollbar.Minimum;
                }

                scrollbar.Value = newValue;
                this.UpdateLayout();

                return max != this.VScrollBar.Maximum;
            }
        }
  
Completed
Last Updated: 12 Sep 2016 11:14 by ADMIN
Introduce a property to change symbol used to separate summaryItems in SummaryRowGroupHeaders.