Edit: We are declining this bug as originally the export options were not meant to respect group properties but only some global GridView properties. However we will add such option in GridViewDocumentExportOptions class. You can follow this feature request => https://feedback.telerik.com/Project/143/Feedback/Details/229211-gridview-add-option-in-gridviewdocumentexportoptions-to-include-exclude-grouph
Currently, the following workaround can be applied: private void RadGridView_Loaded(object sender, RoutedEventArgs e) { var gridView = sender as RadGridView; foreach (var column in gridView.Columns) { if (!column.IsResizable) { Dispatcher.BeginInvoke((Action) (() => { var radGridView = column.Parent; foreach (var header in radGridView.ChildrenOfType<GridViewHeaderCell>()) { if (header.Column.DisplayIndex == column.DisplayIndex) { var leftGripper = header.ChildrenOfType<Thumb>().Where(x => x.Name == "PART_LeftHeaderGripper").First(); { leftGripper.Visibility = Visibility.Collapsed; } } else if (header.Column.DisplayIndex == (column.DisplayIndex - 1)) { var rightGripper = header.ChildrenOfType<Thumb>().Where(x => x.Name == "PART_RightHeaderGripper").First(); { rightGripper.Visibility = Visibility.Collapsed; } } } }), DispatcherPriority.Render); } } }
If you set BorderThickness through a custom CellStyle, the left border is overwritten by our code.
The result string contains wrong header positions and some headers could be missing when the copy of cells (including the header cells) of a column is cancelled using the CopyingCellClipboardContent event. This happens when the ClipboardCopyMode is set to "Cells,Header".
To work this around, you can override the Copied event and replace the string part from the clipboard that contains the headers, with your custom variant.
private void RadGridView_Copied(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
string copiedData = Clipboard.GetText();
int headerEndIndex = copiedData.IndexOf("\r\n");
string headerString = copiedData.Substring(0, headerEndIndex) + "\r\n";
copiedData = copiedData.Remove(0, headerEndIndex);
var gridView = (RadGridView)sender;
var filteredColumns = gridView.Columns.OfType<Telerik.Windows.Controls.GridViewColumn>()
.OrderBy(x => x.DisplayIndex)
.Where(x => x.IsVisible && !excludedColumns.Contains(x));
// Where excludedColumns list contains the columns that shouldn't be copied. In this example, this collection is used in the CopyingCellClipboardContent event handler to remove the corresponding columns from the clipboard copy process.
string newHeader = string.Empty;
for (int i = 0; i < filteredColumns.Count(); i++)
{
var column = filteredColumns.ElementAt(i);
newHeader += column.Header.ToString();
if (i < filteredColumns.Count() - 1)
{
newHeader += "\t";
}
}
copiedData = newHeader + copiedData;
Clipboard.SetText(copiedData);
}
I have a GridView, with ClipboardCopyMode set to "Cells, Header" and defined event CopyingCellClipboardContent :
private void RadGridView1_CopyingCellClipboardContent(object sender, GridViewCellClipboardEventArgs e)
{
// _excludedcolumns = columns excluded from copy operation set in logic before
if (_excludedcolumns.Contains(e.Cell.Column))
{
e.Cancel = true;
}
}
Header cells are empty, not skipped like ordinary cells.
Regards
Janez
Using such negative margin leads to some parts of the template to be actually outside of the control boundaries.
Pixel bug in Lightweight Templates of RadGridView in VisualStudio2013 and Office2013 themes:
No horizontal grid lines when cell has background color:
Most likely bottom margin of PART_CellBorder not set in VisualStudio2013 Theme. In Office2016 PART_CellBorder.Margin="0 0 0 1"
Special chars '+', '-'. '"" modify the default search criteria in the search as you type feature.
Add option to disable this behavior. It would be useful in scenarios with strings starting with + or -.
Also option should be available for setting in MultiColumnComboBox.
Setting ShowDistinctFilters for a RadGridViewColumn hides the distinct values from the filter popup as expected.
But the grid still queries the ItemsSource for distinct values of said column when showing thje popup - it calls something like
MyQueryable.Select(item => item.SomeColumn).Distinct().OrderBy(item => item).Take(1000))
Filtering the data by distinct value using the filter query optimization doesn't work properly when adding more than 500 distinct values. To reproduce this, set the OptimizeDistinctFilterQuery property of the corresponding column to True. The distinct values should be filtered using the ColumnFilterDescriptor and the AddDistinctValue method of the DistinctFilter.
In that case, the filter can get reversed and remove the selected distinct values from the data view, instead of adding only them, as would be expected. Or the filter can stop working at all and display all values from the ItemsSource.
To work this around, instead of using the ColumnFilterDescriptor and the AddDistinctValue method, add a composite filter descriptor manually in the FilterDescriptors of RadGridView.
radGridView.FilterDescriptors.SuspendNotifications();
var distinctValuesFilter = new CompositeFilterDescriptor();
distinctValuesFilter.LogicalOperator = FilterCompositionLogicalOperator.Or;
for (int i = 0; i < 5000; i++)
{
object disctincValue = i;
var filter = new FilterDescriptor("Id", FilterOperator.IsEqualTo, disctincValue);
distinctValuesFilter.FilterDescriptors.Add(filter);
}
radGridView.FilterDescriptors.Add(distinctValuesFilter);
radGridView.FilterDescriptors.ResumeNotifications();
The aggregate values shown in the group headers are wrong when scrolling. This happens when the EnableColumnVirtualization property is set to False and ColumnAggregatesAlignment is NextToGroupKey or BelowGroupKey.
To work this around, set the EnableColumnVirtualization property to True or ColumnAggregatesAlignment to NoAlignment.
Currently, you can set the data format string of the cells in a GridView column by using the DataFormatString property of the column.
Add a mechanism to select the DataFormatString per cell. For example, this can be done using the CellStyleSelector and a new property in the GridViewCell. Or by introducing DataFormatStringSelector property.