"ArgumentException: Must specify valid information for parsing in the string."
The exception is handled internally but results in the filtering not being applied.
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.
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.
Hi Telerik,
I have created a sample project for an issue I have found:
Please see the code behind of the sample.
When removing a column from a grid where the display index was changed, and rows are selected, I do get an ArgumentOutOfRangeException.
Any help is appreciated!
Thank you!
Thomas
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.
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"
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();
Calling the BeginInsert() method of RadGridView, adds a new row at the bottom of the items and scrolls to the newly added row. However, if the vertical scrollbar is not visible and the newly added row makes the viewport so big that the scrollbar should display, the row gets clipped. Also, the vertical scrollbar that was just added is not scrolled to the bottom, which is actually why the row is clipped. Each next insert (after the scrollbar gets visible) will display the added row properly.
To work this around, you can scroll the vertical scrollbar manually to bottom.
private void BeginInsertRow()
{
var scrollViewer = this.gridView.FindChildByType<GridViewScrollViewer>();
bool requestScrollToBottom = false;
if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Collapsed)
{
var panel = this.gridView.FindChildByType<GridViewVirtualizingPanel>();
var sumHeight = (source.Count + 1) * this.gridView.RowHeight;
requestScrollToBottom = sumHeight > panel.ActualHeight;
}
this.gridView.BeginInsert();
if (requestScrollToBottom)
{
scrollViewer.ScrollToBottom();
}
}
Hi
I have a grid where some rows contain child rows. In order to control which rows have the "+" expander icon I use the IsExpandableBinding property. I also have a toolbar which contains a convenience button to collapse all the expanded rows.
This button is bound to a handler which called RasGridView.CollapseAllHierarchyItems(), but this does not have any effect. I've tried removing the IsExpandableBinding property, and the collapse mechanism then works (but I get unwanted expanders on every row).
Hi,
I am currently having issues with RadGridView's group footer: I am trying to add a button to the footer template which is supposed to trigger a command which in turn needs some info on the group it was triggered from*.
Since (unlike the header) there does not seem to be any info on the group available directly within the GroupFooterTemplate, I am pulling the group info from the parent GridViewGroupFooterRow:
<telerik:GridViewDataColumn [...]>
<telerik:GridViewColumn.GroupFooterTemplate>
<DataTemplate>
<Button Command="{Binding DataContext.ShowFooterGroupCommand, RelativeSource={RelativeSource AncestorType=telerik:RadGridView}}"
CommandParameter="{Binding Group.Key, RelativeSource={RelativeSource AncestorType=telerik:GridViewGroupFooterRow}}" />
</DataTemplate>
</telerik:GridViewColumn.GroupFooterTemplate>
</telerik:GridViewDataColumn>
This is working great as long as the RadGridView does not use Row virtualization. However, when I turn on Row virtualization and scroll around for a bit, the value I get passed as the CommandParameter is more or less random and has nothing to do with the group my button is actually located in.
I attached a small example project (.Net 6 but our app uses 4.8 so I set that as the Framework below) for you to try it yourself. Just scroll around and click the buttons while watching the debug output window. You will see that the groups in the output window will not match the group where you actually clicked the button after some scrolling.
Even when virtualizing, the Group key returned when binding to GridViewGroupFooterRow.Group(.Key) should reliably return the key of the actual group my button is placed in. It would be even better if it was somehow possible to get the group directly, without having to resort to FindAncestor.
Regards
Simon Müller
Hofmann Fördertechnik GmbH
* Basically I am trying to give the user a possibility to add new items to the individual groups and I don't want to add the button to the group header since that makes it too easy to accidentally hit the header's RadToggleButton, collapsing the group.
The GridView allows you to drag-to-reorder its columns. When start dragging the clicked element is accessed and a screenshot is made from it. Then the drag visual shows an image of the dragged column header. In some cases the drag visual gets clipped.
To work this around, you can subscribe the GridViewHeaderCell elements to the DragDropManager's DragInitialize event and replace the default drag visual with a custom one.
private void RadGridView_CellLoaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell)
{
Dispatcher.BeginInvoke(new Action(() =>
{
DragDropManager.AddDragInitializeHandler(e.Cell, OnHeaderCellDragInitialize, true);
}));
}
}
private void RadGridView_CellUnloaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell)
{
Dispatcher.BeginInvoke(new Action(() =>
{
DragDropManager.RemoveDragInitializeHandler(e.Cell, OnHeaderCellDragInitialize);
}));
}
}
private void OnHeaderCellDragInitialize(object sender, DragInitializeEventArgs e)
{
var dragSource = e.OriginalSource as GridViewHeaderCell;
if (dragSource != null)
{
var dragVisual = new Border()
{
BorderBrush = Brushes.LightGray,
BorderThickness = new Thickness(1),
Background = new SolidColorBrush(Colors.Bisque) { Opacity = 0.4 },
Width = dragSource.ActualWidth,
Height = dragSource.ActualHeight,
Child = new TextBlock()
{
Text = (string)dragSource.Column.Header,
Margin = new Thickness(5, 0, 5, 0),
VerticalAlignment = VerticalAlignment.Center }
};
e.DragVisual = dragVisual;
}
}