To reproduce: Initially, the row at index 0 is white, when you move it to index 5 it is still white until you hover it: public RadForm1() { InitializeComponent(); this.radGridView1.Columns.Add("Data"); for (int i = 0; i < 100; i++) { this.radGridView1.Rows.Add(i); } this.radGridView1.EnableAlternatingRowColor = true; this.radGridView1.TableElement.AlternatingRowColor = Color.Aqua; } private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.Rows.Move(0, 5); } Workaround: private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.Rows.Move(0, 5); this.radGridView1.Rows[5].InvalidateRow(); }
GridTimeColumn will display and allow user to edit with TimeEditor Time and Time-Span column types from the Database.
If current culture uses comma as delimeter, the MS Excel cannot handle the decimal values in a right way.
To reproduce: the issue is reproducible in the Demo application >> GridView >> Tabbed Views. Follow the steps from the gif file. Workaround: private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridDetailViewCellElement cell = e.CellElement as GridDetailViewCellElement; if (cell != null) { cell.MinSize = new Size(e.CellElement.Parent.Size.Width - this.radGridView1.TableElement.GroupIndent , 10); } }
How to reproduce: check the code snippet below and the attached video. public partial class Form1 : Form { public Form1() { InitializeComponent(); this.SetupGrid(); this.radGridView1.Dock = DockStyle.Fill; this.radGridView1.UseScrollbarsInHierarchy = true; } private void SetupGrid() { BindingList<Teacher> teachers = new BindingList<Teacher>(); BindingList<Student> students = new BindingList<Student>(); for (int i = 1; i <= 2; i++) { teachers.Add(new Teacher { TeacherId = i, TeacherFirstName = "FirstName " + i, TeacherLastName = "FirstName " + i, }); for (int j = 1; j <= 3; j++) { students.Add(new Student { SudentId = j, TeacherId = i, SudentFirstName = "Student " + j, SudentLastName = "LastName " + j, }); } } this.radGridView1.Templates.Clear(); this.radGridView1.DataSource = null; this.radGridView1.DataSource = teachers; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewTemplate template = new GridViewTemplate(); template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; template.DataSource = students; this.radGridView1.MasterTemplate.Templates.Add(template); GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate); relation.ChildTemplate = template; relation.RelationName = "TeacherStudents"; relation.ParentColumnNames.Add("TeacherId"); relation.ChildColumnNames.Add("TeacherId"); this.radGridView1.Relations.Add(relation); this.radGridView1.ChildViewExpanded += RadGridView1_ChildViewExpanded1; } private void RadGridView1_ChildViewExpanded1(object sender, ChildViewExpandedEventArgs e) { } private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.SaveLayout("..\\..\\save.xml"); } private void radButton2_Click(object sender, EventArgs e) { this.radGridView1.LoadLayout("..\\..\\save.xml"); } } public class Teacher { public int TeacherId { get; set; } public string TeacherFirstName { get; set; } public string TeacherLastName { get; set; } } public class Student { public int SudentId { get; set; } public int TeacherId { get; set; } public string SudentFirstName { get; set; } public string SudentLastName { get; set; } } Workaround: prevent the child templates from serializing public class MyRadGridView : RadGridView { public override string ThemeClassName { get { return typeof(RadGridView).FullName; } } public override void SaveLayout(string fileName) { MyGridViewLayoutSerializer ser = new MyGridViewLayoutSerializer(this.XmlSerializationInfo); using (XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.UTF8)) { writer.Formatting = Formatting.Indented; writer.WriteStartElement("RadGridView"); ser.WriteObjectElement(writer, this); } } } public class MyGridViewLayoutSerializer : GridViewLayoutSerializer { public MyGridViewLayoutSerializer(ComponentXmlSerializationInfo componentSerializationInfo) : base(componentSerializationInfo) { } protected override bool ShouldSerializeValue(object component, PropertyDescriptor property, PropertySerializationMetadata overwriteMetadata) { if (property.Name == "Templates") { return false; } return base.ShouldSerializeValue(component, property, overwriteMetadata); } }
To reproduce: use the following code snippet: Sub New() InitializeComponent() Dim view As New ColumnGroupsViewDefinition() view.ColumnGroups.Add(New GridViewColumnGroup("Customer Contact")) view.ColumnGroups.Add(New GridViewColumnGroup("Details")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Address")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Contact")) view.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(0).Rows(0).ColumnNames.Add("CompanyName") view.ColumnGroups(0).Rows(0).ColumnNames.Add("ContactName") view.ColumnGroups(0).Rows(0).ColumnNames.Add("ContactTitle") view.ColumnGroups(1).Groups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("Address") view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("City") view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("Country") view.ColumnGroups(1).Groups(1).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(1).Rows(0).ColumnNames.Add("Phone") view.ColumnGroups(1).Groups(1).Rows(0).ColumnNames.Add("Fax") RadGridView1.ViewDefinition = view End Sub Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.CustomersTableAdapter.Fill(Me.NwindDataSet.Customers) Me.RadGridView1.BestFitColumns(BestFitColumnMode.AllCells) RadGridView1.Columns("Fax").IsVisible = False RadGridView1.Columns("Phone").IsVisible = False Dim spreadExporter As GridViewSpreadExport = New GridViewSpreadExport(Me.RadGridView1) Dim exportRenderer As New SpreadExportRenderer() spreadExporter.HiddenColumnOption = Export.HiddenOption.ExportAsHidden spreadExporter.FreezeHeaderRow = True spreadExporter.ExportGroupedColumns = True spreadExporter.ExportChildRowsGrouped = True spreadExporter.ExportVisualSettings = True spreadExporter.ExportHierarchy = True spreadExporter.ExportViewDefinition = True spreadExporter.ExportFormat = SpreadExportFormat.Xlsx Dim fileName = "..\..\export" & DateTime.Now.ToLongTimeString().Replace(":", "_") & ".xlsx" spreadExporter.RunExport(fileName, exportRenderer) Process.Start(fileName) End Sub Workaround: instead of hiding all the columns inside a group, hide the entire group: Sub New() InitializeComponent() Dim view As New ColumnGroupsViewDefinition() view.ColumnGroups.Add(New GridViewColumnGroup("Customer Contact")) view.ColumnGroups.Add(New GridViewColumnGroup("Details")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Address")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Contact")) view.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(0).Rows(0).ColumnNames.Add("CompanyName") view.ColumnGroups(0).Rows(0).ColumnNames.Add("ContactName") view.ColumnGroups(0).Rows(0).ColumnNames.Add("ContactTitle") view.ColumnGroups(1).Groups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("Address") view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("City") view.ColumnGroups(1).Groups(0).Rows(0).ColumnNames.Add("Country") view.ColumnGroups(1).Groups(1).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(1).Rows(0).ColumnNames.Add("Phone") view.ColumnGroups(1).Groups(1).Rows(0).ColumnNames.Add("Fax") RadGridView1.ViewDefinition = view view.ColumnGroups(1).Groups.Last().IsVisible=False End Sub
To reproduce: - Use a column with numbers stored as strings. - Set the data type to decimal - The columns should be sorted according to the number value not alphabetically. Workaround: var col = new GridViewTextBoxColumn(); col.DataTypeConverter = new DecimalConverter(); col.FieldName = "Dosage"; col.UseDataTypeConverterWhenSorting = true; col.DataType = typeof(decimal); radGridView1.Columns.Add(col); public class DecimalConverter : TypeConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destination_type) { if (destination_type == typeof(decimal)) { return true; } return base.CanConvertTo(context, destination_type); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destination_type) { if (destination_type == typeof(decimal)) { return decimal.Parse(value.ToString()); } return base.ConvertTo(context, culture, value, destination_type); } }
Workaround: private void radGridView1_ConditionalFormattingFormShown(object sender, EventArgs e) { ConditionalFormattingForm f = sender as ConditionalFormattingForm; if (f != null) { RadPropertyGrid radPropertyGridProperties = f.Controls["radPropertyGridProperties"] as RadPropertyGrid; radPropertyGridProperties.ItemFormatting += radPropertyGridProperties_ItemFormatting; radPropertyGridProperties.ItemFormatting += radPropertyGridProperties_ItemFormatting; } } private void radPropertyGridProperties_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e) { if (e.Item.Label=="CellFont") { e.Item.Label = "aaa"; } }
This can be used for large amounts of data. Check this - https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfstreamwriter
The scenario which should be covered is selecting some data from Excel and pasting in the new row of RadGridView. This is an easy way for inserting data in the grid.
To reproduce: please refer to the attached screenshot public RadForm1() { InitializeComponent(); ThemeResolutionService.ApplicationThemeName = "Fluent"; this.BackColor = Color.White; this.radGridView1.EnableGrouping = false; } Workaround: this.radGridView1.TableElement.Margin = new Padding(0, 1, 0, 0);
To reproduce: run the attached sample project and activate the editor for the cell. You will notice that the row's height is now adjusted and single line text is displayed. It seems that the issue occurs because of the set Font property of the grid. Workaround: private void RadGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { e.Row.MinHeight = e.Row.Height + 3; RadTextBoxEditor tbEditor = e.ActiveEditor as RadTextBoxEditor; if (tbEditor != null) { tbEditor.Multiline = true; } } private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e) { e.Row.MinHeight = 0; }
A possible workaround is to use the following KB and change how it is implemented to iterate the MasterTemplate.Rows collection instead of the ViewInfo.Rows collection https://www.telerik.com/support/kb/winforms/gridview/details/add-check-all-in-the-header-cell-for-a-gridviewcheckboxcolumn
To reproduce: - Set IsSearchAsync to false. - Search for something and press down arrow to navigate to the last found item. - Press down again the selection is not moved to the first item.
Use attached to reproduce. Workaround: private void RadGridView1_UserAddingRow(object sender, GridViewRowCancelEventArgs e) { e.Cancel = true; }
Use attached to reproduce: - Just search for something and you will notice that the waiting bar does not disappear. Workaround: public RadForm1() { InitializeComponent(); radGridView1.MasterView.TableSearchRow.IsSearchAsync = false; radGridView1.MasterView.TableSearchRow.SearchProgressChanged += TableSearchRow_SearchProgressChanged; } private void TableSearchRow_SearchProgressChanged(object sender, SearchProgressChangedEventArgs e) { var searchCell = radGridView1.TableElement.FindDescendant<GridSearchCellElement>(); if (searchCell != null) { var waitingBar = searchCell.Children[1] as RadWaitingBarElement; waitingBar.StopWaiting(); waitingBar.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; } }