The height of the column footer is not updated properly to autofit the footer's content. Actually, this works when the footer content becomes bigger than the current (or the default) value, but if you change the content with a smaller one, the bigger height remains. In other words, the footer height autofits when the content becomes bigger but it doesn't decrease when the content becomes smaller after that.
To work this around, you can subscribe to the CellLoaded event and use reflection to update one of the internal properties of the panel that draws the footer cells.private void gridView_CellLoaded(object sender, CellEventArgs e)
{
if (e.Cell is GridViewFooterCell)
{
var row = e.Cell.ParentRow;
Dispatcher.BeginInvoke(new Action(() =>
{
var aggregatesList = row.ChildrenOfType<AggregateResultsList>(); // the exact type of children that should be used to get the new height may vary based on your column Footer contents
if (aggregatesList.Count() > 0)
{
var height = aggregatesList.Max(x => x.ActualHeight);
var cellsPanel = e.Cell.ParentOfType<GridViewCellsPanel>();
PropertyInfo minRowHeightProp = cellsPanel.GetType().GetProperty("MinRowHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
object minRowHeightPair = minRowHeightProp.GetValue(cellsPanel);
PropertyInfo heightProp = minRowHeightPair.GetType().GetProperty("Second");
heightProp.SetValue(minRowHeightPair, height);
}
}));
}
}
When the RadGridView is filtered you can get all items in the data view using the Items collection property of the control. The count can be accessed with the gridView.Items.Count property.
If the RadGridView is grouped and then filtered, the Items.Count no longer returns the correct value. The count doesn't take into account the items that are in collapsed groups. Instead the count contains only the expanded group objects.
To work this around, use the following code instead of gridView.Items.Count.
int count = gridView.Items.OfType<object>().Count();
The GridViewSelectColumn displays a CheckBox in its header, which selects all rows in the column. If the CheckBox is unchecked, and you click it to check the items, the items get selected/checked. However, the CheckBox doesn't get check until the second click.
This reproduces only when the RadGridView is grouped and also the groups are collapsed so that no data records are visible.
To work this around, you can replace the default CheckBox with a new one in the column's Header. Then, manually select and deselect the items. You can use the CheckBox MouseLeftButtonDown or Checked/Unchecked events. Note that it is important to wrap the CheckBox in the Header, in another control (like a Grid in the example below), in order to avoid the default RadGridView logic to kick-in.
<telerik:GridViewSelectColumn>
<telerik:GridViewSelectColumn.Header>
<Grid>
<CheckBox PreviewMouseLeftButtonDown="CheckBox_PreviewMouseLeftButtonDown"/>
</Grid>
</telerik:GridViewSelectColumn.Header>
</telerik:GridViewSelectColumn>
private void CheckBox_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var checkBox = (CheckBox)sender;
if (checkBox.IsChecked.Value)
{
this.GridView.SelectedItems.Clear();
}
else
{
this.GridView.SelectAll();
}
}
The selection with the Shift key when SelectionMode=Extended no longer works in the default Nested rendering mode of RadGridView. This reproduces only when the data view is grouped.
To work this around, set the GroupRenderMode property of RadGridView to Flat.
<telerik:RadGridView GroupRenderMode="Flat" />
The RadGridView control hangs when the frozen columns are enabled and the application is resized. The exact resizing depends on the screen resolution and the exact new size. This was originally recreated on a monitor with 1600x900 resolution 125% DPI and the application was maximized (resized from restored to full screen size). The issue occurs in the Fluent theme. Also, the FluentPalette.Palette.ScrollBarsMode static property should be set to Normal.
To work this around, you can overrider the MeasureOverride method of RadGridView and add the following code:
public class CustomGridView: RadGridView
{
private static readonly PropertyInfo internalColumnsProp = typeof(GridViewDataControl).GetProperty("InternalColumns", BindingFlags.Instance | BindingFlags.NonPublic);
private static MethodInfo invalidateColumnsMethod;
protected override Size MeasureOverride(Size availableSize)
{
if (EnableRowVirtualization && !double.IsInfinity(availableSize.Height))
{
var internalColumns = internalColumnsProp.GetValue(this);
if (invalidateColumnsMethod == null)
{
invalidateColumnsMethod = internalColumns.GetType().GetMethod("InvalidateColumnWidthsCalculation", BindingFlags.Instance | BindingFlags.NonPublic);
}
invalidateColumnsMethod.Invoke(internalColumns, null);
}
return base.MeasureOverride(availableSize);
}
When adding a button cell as below, if the button cell is selected the button doesn't work when tapping it.
<telerik:GridViewDataColumn Header="Config"
DataMemberBinding="{Binding .}" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<!-- Adding telerik:TouchManager.TouchMode="None" solves the issue -->
<telerik:RadButton HorizontalAlignment="Center" Style="{StaticResource MyButtonStyle}"
Margin="2" Padding="1" Width="Auto" Height="Auto"
Command="{Binding DataContext.ShowExtraConfigurationCommand, RelativeSource={RelativeSource AncestorType=Window}}"
CommandParameter="{Binding .}" ToolTip="Config">
<telerik:RadGlyph Glyph="{StaticResource GlyphGear}"/>
</telerik:RadButton>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
As stated in the comment, adding the property below to the RadButton solves the issue.
telerik:TouchManager.TouchMode="None"
I have attached a sample project in which the error occurs, simply tap a button, close the MessageBox and tap the same button again. Thank you for your time!
In the case where some of the columns are hidden and all of the columns' display indexes are changed, applying grouping could result in some of the cells from the columns that have custom CellTemplate to not receive it.
To work this around, you could manually change the widths of the columns by iterating the Columns collection as shown below:
foreach (var column in this.GridView.Columns)
{
GridViewLength length = column.Width;
if (length.IsAbsolute)
{
column.Width = new GridViewLength(length.Value + 0.00001);
}
}
Hello Telerik Team! Are there any new informations concerning the below BUG? (UniqueName-Property is causing binding errors) Is this fixed in one of the current versions? What are proper workarounds? Identical Problem for Sylverlight: http://www.telerik.com/community/forums/silverlight/gridview/gridviewdatacolumn-data-binding-to-uniquename---why.aspx Regards Daniel (DevCraft Customer)
'Cell is already in the collection' exception is thrown when multiple cells are copied and pasted in a sorted column
Resolved with LIB version 2014.1.0428.