The RowForeColor property of a conditional formatting object does not apply to the column which the condition is defined for.
SortDescriptors does not apply when they are added to control with no DataSource defined and no rows added. The added rows from the user are not sorted.
The format specifier 'tt' in the ExcelExportFormatString property should be outputed as 'AM' or 'PM'. For the formatting to work correctly the users have to set the property to Excel format codes not .NET format strings. Here is the list of excel's format codes: http://office.microsoft.com/en-us/excel-help/number-format-codes-HP005198679.aspx
The RadGridView pinned columns remain in the collection when the corresponding columns are removed from the control.
Incorrect RadGridView behavior when changing sorted GridViewCheckBoxColumn checkboxes states.
The DataType property of GridViewComboBoxColumn does not work as expected in the following scenario: 1. Set DataSource to GridViewComboBoxColumn so that the ValueMember of the column is of type Integer. 2. Set the DataType property of the column to Decimal. 3. Set DataSource of RadGridView so that the FieldName of the above GridViewComboBoxColumn is of type Decimal. 4. RadGridView throws exception.
The RadGridView scrollbars do not behave correctly when the Clear method of the Rows collection is called and new rows are added immediately after that.
The group summary rows are not updated correctly when a data row is moved from one group to another.
If two conditional formatting objects apply to the same cell and the cell meets both conditions, the settings from both of them should apply to the cell (if they do not apply to the same property).
The issue appears when the current column of the control is changed programmatically in a way that the RadGridView's horizontal scrollbar value needs to be positioned between its minimum and maximum value.
The vertical scrollbar of RadGridView is not correctly calculated in a scenario with AutoSizeRows and added rows to the control using the Rows.NewRow() method.
IMPROVE. RadGridView - when sorting grouped combo box column the DisplayMemberSort is not taken into consideration
The binding source filtering should be synchronized with the grid one in case other controls are using the same binding source.
To reproduce:
- add RadGridView and fill it with data;
- use the following code for saving the layout: string layout;
using (MemoryStream ms = new MemoryStream())
{
radGridView1.SaveLayout(ms);
ms.Position = 0;
byte[] buffer = new byte[ms.Length - 1];
ms.Read(buffer, 0, buffer.Length);
layout = Convert.ToBase64String(buffer);
ms.Close();
}
When you try to load the saved layout, using the following code, DataException is thrown:
using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(layout)))
{
radGridView1.LoadLayout(stream);
}
Workaround: save the layout in xml file
ConditionalFormattingObjects should be cleared or they should be applied after rebinding completes. WORKAROUND: save the ConditionalFormattingObjects, reset the data source and then restore them in order to overcome the observed error:
To reproduce:
Dim RadGridView1 As New RadGridView
Me.Controls.Add(RadGridView1)
RadGridView1.Dock = DockStyle.Fill
Dim r As New Random()
Dim table As New DataTable()
table.Columns.Add("ID", GetType(Integer))
To reproduce:
1. Add RadGridView with 3 columns and add summary row
2. When is fired the ViewCellFormatting event, set the Text property of GridSummaryCellElement
3. Run project and text is not visible.
void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridSummaryCellElement summaryCell = e.CellElement as GridSummaryCellElement; if (summaryCell != null) { if (summaryCell.ColumnInfo.FieldName == "ProductID") { summaryCell.Text = "Total"; } } }
Workaround:
Set FormatString property instead Text
property void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridSummaryCellElement summaryCell = e.CellElement as GridSummaryCellElement; if (summaryCell != null) { if (summaryCell.ColumnInfo.FieldName == "ProductID") { summaryCell.FormatString = "Total"; } } }
To reproduce:
-add RadGridView and use the following code: public Form1() { InitializeComponent(); radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; radGridView1.AddNewRowPosition = SystemRowPosition.Bottom; radGridView1.Columns.Add("A"); radGridView1.Columns.Add("B"); radGridView1.Columns.Add("C"); radGridView1.CellValidating += radGridView1_CellValidating; } void radGridView1_CellValidating(object sender, CellValidatingEventArgs e) { if ((string)e.Value == "11") { e.Cancel = true; } } Follow the steps: 1. First go to A and enter some value, hit TAB and go to B and enter some value. 2. Hit TAB and move to C. 3. Enter "11". 4. Hit TAB. Validation fails, but the new row is entered (calling radGridView1_RowValidating and ignoring e.Cancel = true; of radGridView1_CellValidating) 5. The erroneous value is copied to Column C in the new "new row". 6. radGridView1_CellValidating is called again.
Workaround:
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior; gridBehavior.UnregisterBehavior(typeof(GridViewNewRowInfo)); gridBehavior.RegisterBehavior(typeof(GridViewNewRowInfo), new CustomGridNewRowBehavior()); public class CustomGridNewRowBehavior : GridNewRowBehavior { protected override bool ProcessTabKey(KeyEventArgs keys) { GridViewNewRowInfo newRowInfo = (GridViewNewRowInfo)this.GridViewElement.CurrentRow; if (newRowInfo.PinPosition == PinnedRowPosition.Bottom || newRowInfo.RowPosition == SystemRowPosition.Bottom) { FieldInfo fi = this.GridControl.GridBehavior.GetType().GetField("defaultRowBehavior", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); GridRowBehavior rowBehavior = fi.GetValue(this.GridControl.GridBehavior) as GridRowBehavior; MethodInfo mi = rowBehavior.GetType().GetMethod("ProcessTabKey", BindingFlags.NonPublic | BindingFlags.Instance); return (bool)mi.Invoke(rowBehavior, new object[] { keys }); } return base.ProcessTabKey(keys); } }
To reproduce: -add a RadGridView and a RadButton; use the following code: public Form1() { InitializeComponent(); //Create a child template GridViewTemplate childTemplate = new GridViewTemplate(); childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.Templates.Add(childTemplate); GridViewRelation relation = new GridViewRelation(); relation.ChildTemplate = childTemplate; relation.ParentTemplate = this.radGridView1.MasterTemplate; relation.ChildColumnNames.Add("B1"); relation.ParentColumnNames.Add("A1"); this.radGridView1.Relations.Add(relation); } private DataTable dtParent; private DataTable dtChild; private void Form1_Load(object sender, EventArgs e) { //Add data dtParent = new DataTable(); dtParent.Columns.AddRange(new DataColumn[] { new DataColumn("A1") }); dtChild = new DataTable(); dtChild.Columns.AddRange(new DataColumn[] { new DataColumn("B1"), new DataColumn("B2") }); DataRow dr = dtParent.NewRow(); dr["A1"] = "0"; dtParent.Rows.Add(dr); for (int i = 0; i < 40; i++) { DataRow drChild = dtChild.NewRow(); drChild["B1"] = "0"; drChild["B2"] = ""; dtChild.Rows.Add(drChild); } this.radGridView1.MasterTemplate.DataSource = dtParent; this.radGridView1.Templates[0].DataSource = dtChild; } private void radButton1_Click(object sender, EventArgs e) { DataRow drNew = this.dtChild.NewRow(); drNew["B1"] = "0"; drNew["B2"] = "New"; this.dtChild.Rows.Add(drNew); }
If you expand the first parent row and scroll down to the last child row, clicking over the button does not refresh the vertical scroll-bar correctly. The new row shows only half. You can not scroll to the end.
Workaround: refresh the vertical scroll-bar manually: private void radButton1_Click(object sender, EventArgs e) { DataRow drNew = this.dtChild.NewRow(); drNew["B1"] = "0"; drNew["B2"] = "New"; this.dtChild.Rows.Add(drNew); int val = radGridView1.TableElement.VScrollBar.Value; foreach (GridViewRowInfo row in radGridView1.Rows) { if (row.IsExpanded) { val = radGridView1.TableElement.VScrollBar.Value; row.IsExpanded = false; row.IsExpanded = true; radGridView1.TableElement.VScrollBar.Value = val; } } }
To reproduce:
-add RadGridView with 2 columns - ID and Name;
-add RadButton and use the following code:
public Form1() { InitializeComponent(); AddSelfReferencingColumns(grid, "Id", "Parent.Id"); this.grid.DataSource = TestDataGenerator.GenerateTestData(); } public void AddSelfReferencingColumns(RadGridView grid, string childKey, string parentKey) { GridViewTextBoxColumn col1 = new GridViewTextBoxColumn("hiddenColumnId", childKey); GridViewTextBoxColumn col2 = new GridViewTextBoxColumn("hiddenColumnParentId", parentKey); grid.MasterTemplate.Columns.Add(col1); grid.MasterTemplate.Columns.Add(col2); grid.Columns["hiddenColumnId"].IsVisible = false; grid.Columns["hiddenColumnParentId"].IsVisible = false; grid.Relations.AddSelfReference(grid.MasterTemplate, "hiddenColumnId", "hiddenColumnParentId"); } void refreshButton_Click(object sender, System.EventArgs e) { this.grid.DataSource = TestDataGenerator.GenerateTestData(); } class TestDataGenerator { public static IList<TestObject> GenerateTestData() { IList<TestObject> result = new List<TestObject>(); TestObject top = new TestObject { Id = 1, Name = "Top" }; result.Add(top); for (int i = 1; i < 4; i++) { TestObject firstChild = new TestObject() { Id = 10 * i, Name = string.Format("First level child {0}", i), Parent = top }; result.Add(firstChild); for (int j = 1; j < 10; j++) { TestObject secondChild = new TestObject() { Id = 10 * i + j, Name = string.Format("Second level child {0}", j), Parent = firstChild }; result.Add(secondChild); } } return result; } } class TestObject { public long Id { get; set; } public string Name { get; set; } public TestObject Parent { get; set; } }
Steps to reproduce: 1.Type in Name column filter i.e. "F" 2.Press refresh button. The grid is empty, even though the new list contains the same data (different objects).
Workaround: void refreshButton_Click(object sender, System.EventArgs e) { FilterDescriptorCollection filters = new FilterDescriptorCollection(); foreach (FilterDescriptor filterItem in this.grid.FilterDescriptors) { filters.Add(filterItem); } this.grid.DataSource = TestDataGenerator.GenerateTestData(); this.grid.FilterDescriptors.Clear(); foreach (FilterDescriptor filter in filters) { this.grid.FilterDescriptors.Add(filter); } }