This is not considered an issue, it is how RadGridView works. Here are more details:
In order for a GridDetailViewCellElement to display a pageview instead of a single table element, either the template of the row holding it has to have more than one child template, or its ShowChildViewCaptions should be true.
Once there is a page view, the tabs in it will be visible at all times, except when some of the templates has no rows and AllowAddNewRow for it is false – if it does not have any rows and the user cannot add row, it is considered that there is no need from it.
If one needs to change the visibility of the tabs, this can be done in the ViewCellFormatting event:
private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
GridDetailViewCellElement detailCell = e.CellElement as GridDetailViewCellElement;
if (detailCell != null) {
foreach (RadPageViewItem item in detailCell.PageViewElement.Items) {
item.Visibility = Telerik.WinControls.ElementVisibility.Visible;
}
}
}
To reproduce: add a RadGridView with many columns so the horizontal scroll bar will be shown. Start navigating by pressing the right arrow key. You will notice that when you reach the last visible column in the current view, navigating to the next column changes the whole view and the current column is displayed at the beginning of the view. The expected behavior is that after pressing the right arrow key the horizontal scroll bar will move only one column forward.
To reproduce: - Bind the grid to an ObservableCollection and set its AddNewBoundRowBeforeEdit property to true. - Click in the new row and then click back in already added row.
To reproduce:
Add a RadGridView and set the Form.UseWaitCursor property to true. When the cursor is positioned inside the RadGridView the cursor is set back to default.
Workaround:
public RadForm1()
{
InitializeComponent();
radGridView1.GridBehavior = new CustomRowBehavior();
}
public class CustomRowBehavior : BaseGridBehavior
{
public override bool OnMouseMove(MouseEventArgs e)
{
Cursor cursor = this.GridControl.Cursor;
bool result = base.OnMouseMove(e);
this.GridControl.Cursor = cursor;
return result;
}
}
To reproduce: - Set EnterKeyMode to EnterMovesToNextRow. - Enter an invalid value in the first cell and press enter two times. - Enter valid value and press enter again. - You will notice that the current row is moved appropriately.
To reproduce: 1. Add RadGridView with 2 columns 2. Sort first column. Then sort second column. 3. Break in the SortChanged event handler method 4. e.NewItems[0].PropertyName is 'column1' and e.OldItems[0].PropertyName is 'column2', the values are swapped
Let's say that we have the following scenario: the end-user clicks the checkbox editor of RadGridView. The developer might want to commit the value in the corresponding cell right after the end-user clicks the checkbox and it also might be required that the edit mode is ended. Currently, you can commit a value in the cell, but you can't end the edit mode of RadGridView.
FIX. RadGridView ComboBoxColumn when in data bound mode with auto complete set to SuggestAppend wrong results might be obtained. How to reporduce: Use RadGridView with ComboBoxColumn and set AutoCompleteMode to SuggestAppend. Also set DropDownStyle to DropDown. When start typing if nonexisting item gets typed the column will append the closest available item to the cell.
Add support for the GridViewComboBoxColumn to initialize properly when the BindingList it is bound to is empty.
To reproduce: Add a row to RadGridView and select it. Then remove it from the rows. Check the SelectedRows collection and you will see that the row is inside. The collection should not contain removed rows and the SelectionChanged event should be fired when a selected row is removed. Workaround: Set the IsSelected property of the row to false prior removing it.
To reproduce: add a RadGridView and bind it to Employees data table. Use the following code snippet: Me.RadGridView1.EnableGrouping = True Me.RadGridView1.EnableFiltering = True Dim summaryItem As New GridViewSummaryItem() summaryItem.Name = "Address" summaryItem.Aggregate = GridAggregateFunction.Count Dim summaryRowItem As New GridViewSummaryRowItem() summaryRowItem.Add(summaryItem) Me.RadGridView1.SummaryRowsTop.Add(summaryRowItem) Me.RadGridView1.MasterTemplate.ShowParentGroupSummaries = True 1. Group by "Title" and expand "Sales Representative" group. 2. Group by "Country" and "City". 3.Expand "Sales Representative" group >> "UK" sub-group >> "London" sub-group. You will notice that the summary row shows "3", because you actually have 3 employees in "London" group. 4.Filter by "FirstName" (Contains: "a" for example). As a result 2 employess will remain in "London" group, but the summary row will continue displaying "3". The attached gif file illustrates better the described behavior. Workaround: in the FilterChanged event store the applied GroupDescriptors, clear the RadGridView.GroupDescriptors collection, and add again the stored descriptors. Note that it is necessary to store the expanded groups and restore their state as well.
To reproduce: add a RadGridView and bind it to Employees data table. 1. Group by "Title". 2. Group by "Country". 3. Group by "City". If you try to expand the "Sales Representative" group, no rows will be displayed. Please refer to the attached gif file, illustrating better the obtained behavior.
RadGridView scrolls to right when clicking on a cell that is larger than the visible area.
RadGridView is throwing exception when loading layout that contains a GroupDescriptor with predefined Format with Aggregate function.
Steps to reproduce:
1. Add GroupDescriptor:
Dim descriptor As New GroupDescriptor
descriptor.GroupNames.Add("column3", System.ComponentModel.ListSortDirection.Ascending)
descriptor.Aggregates.Add("Sum(column3)")
descriptor.Format = "{0}: {1} Total montant : {2:c2}"
Me.RadGridView1.GroupDescriptors.Add(descriptor)
2. Save Layout
3. Load Layout
To reproduce: - just subscribe to the event, sort the grid to fire it and check the property value Wordaround: ((SortDescriptor)e.NewItems[0]).PropertyName
The alternating row color in RadGridView does not work when the control is in unbound mode and LoadFrom method is used. Resolution: The issue is duplicated with feedback item FIX. RadGridView - AlternatingRowColor does not work when data is loaded in the RadGridView from a IDataReader Here is the link to item: http://feedback.telerik.com/Project/154/Feedback/Details/112656-fix-radgridview-alternatingrowcolor-does-not-work-when-data-is-loaded-in-the-r
Steps to reproduce: 1. Add a RadGridView to a form. 2. Add a code that would load data in the RadGridView from an IDataReader: radGridView1.MasterTemplate.LoadFrom(iReader); 3. Set EnableAlternatingRowColor to true and set some AlternatingRowColor 4. Run the project and you will see that the alternating row color is not applied.
RadDateTimeEditor the entire date cannot be selected when the editor is initialized.
Setting the custom format is not applied to the cell. To reproduce:
Dim customColumn As New GridViewDateTimeColumn()
customColumn.Width = 200
customColumn.Name = "custom"
customColumn.EditorType = GridViewDateTimeEditorType.TimePicker
customColumn.FormatString = "{0:HH:mm}"
customColumn.Format = DateTimePickerFormat.Custom
customColumn.CustomFormat = "HH:mm"
RadGridView1.MasterTemplate.Columns.Add(customColumn)
RadGridView1.Rows.Add(DateTime.Now)
To reproduce:
Declare the following classes:
public class Test
{
public string Name { get; set; }
public Child Child { get; set; }
}
public class Child
{
public string ChildName { get; set; }
public override string ToString()
{
return ChildName;
}
}
Add the following columns:
gridViewTextBoxColumn1.FieldName = "Name";
gridViewTextBoxColumn1.HeaderText = "column1";
gridViewTextBoxColumn1.Name = "column1";
gridViewTextBoxColumn2.FieldName = "Child";
gridViewTextBoxColumn2.HeaderText = "column2";
gridViewTextBoxColumn2.Name = "column2";
this.radGridView1.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
gridViewTextBoxColumn1,
gridViewTextBoxColumn2});
this.radGridView1.Name = "radGridView1";
this.radGridView1.Size = new System.Drawing.Size(429, 176);
this.radGridView1.TabIndex = 0;
this.radGridView1.Text = "radGridView1";
Bind RadGridView to the following data:
var data = new List<Test>();
for (int i = 0; i < 10; i++)
{
data.Add(new Test
{
Name = "Name" + i,
Child = new Child
{
ChildName = "Child " + i
}
});
}
Export to Excel:
ExportToExcelML excelExporter = new ExportToExcelML(radGridView1);
excelExporter.RunExport(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"test.xls"));
You will notice that column2 will not have text
Workaround:
Subscribe to the ExcelCellFormatting event:
void excelExporter_ExcelCellFormatting(object sender, Telerik.WinControls.UI.Export.ExcelML.ExcelCellFormattingEventArgs e)
{
if (e.ExcelCellElement.Data.DataItem.GetType().IsClass)
{
e.ExcelCellElement.Data.DataItem = e.ExcelCellElement.Data.DataItem.ToString();
}
}