The check box should be placed in the header cell (if the users wants to). Additionally it should be able to control both one level and hierarchy Resolution: You need to set the EnableHeaderCheckBox property to true. Please refer in help article for more information: http://www.telerik.com/help/winforms/gridview-columns-gridviewcheckboxcolumn.html
All event handlers should be made virtual. All controls should be public or have properties.
Consider the case where there are many child views and you want to export only the ones that actually contain data. Currently, you can either export only one view or all. One should be able to pass all the views in the ChildViewExporting event.
Workaround: handle the GridViewPdfExport.CellFormatting event and apply the column`s format string Public Class Form1 Sub New() InitializeComponent() Me.RadGridView1.DataSource = Me.GetData() Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill Dim decimalColumn = DirectCast(Me.RadGridView1.Columns("Money"), GridViewDecimalColumn) decimalColumn.DecimalPlaces = 0 decimalColumn.FormatString = "{0:C0}" Dim dateTimeColumn = DirectCast(Me.RadGridView1.Columns("Date"), GridViewDateTimeColumn) dateTimeColumn.FormatString = "{0:D}" End Sub Private Function GetData() As Object Dim dataTable As New DataTable() dataTable.Columns.Add("Id", GetType(Integer)) dataTable.Columns.Add("Name", GetType(String)) dataTable.Columns.Add("Money", GetType(Decimal)) dataTable.Columns.Add("Date", GetType(DateTime)) For i As Integer = 0 To 999 dataTable.Rows.Add(i, "Name " & i, i * 10, DateTime.Now.AddDays(i)) Next Return dataTable End Function Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click Dim pdfExporter = New GridViewPdfExport(Me.RadGridView1) AddHandler pdfExporter.CellFormatting, AddressOf pdfExporter_CellFormatting Dim renderer = New PdfExportRenderer() Dim fileName As String = "..\..\exported-grid.pdf" pdfExporter.RunExport(fileName, renderer) End Sub Private Sub pdfExporter_CellFormatting(sender As Object, e As PdfExportCellFormattingEventArgs) If e.RowIndex > -1 Then e.CellElement.Text = TryCast(RadDataConverter.Instance.Format(e.Row.Cells(e.ColumnIndex).Value, GetType(String), e.Column), String) End If End Sub End Class
Workaround: private void RadForm1_Load(object sender, EventArgs e) { this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories); this.productsTableAdapter.Fill(this.nwindDataSet.Products); radGridView1.AutoGenerateHierarchy = true; radGridView1.DataSource = this.nwindDataSet; radGridView1.DataMember = "Categories"; radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded; radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded; } Image expandedSign; Image collapsedSign; private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridGroupExpanderCellElement expanderCell = e.CellElement as GridGroupExpanderCellElement; if (expanderCell != null) { if (expandedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == false) { expandedSign = expanderCell.Expander.SignImage.Clone() as Image; } if (collapsedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == true) { collapsedSign = expanderCell.Expander.SignImage.Clone() as Image; } if (expandedSign != null && collapsedSign != null) { expanderCell.Expander.SignImage = null; } if (e.Row.IsExpanded) { expanderCell.Expander.Image = collapsedSign; } else { expanderCell.Expander.Image = expandedSign; } expanderCell.Expander.ImageLayout = ImageLayout.None; expanderCell.Expander.DrawImage = true; expanderCell.Expander.ImageAlignment = ContentAlignment.TopLeft; } }
The CustomSorting event should manipulate the pinned rows as well. Thus, the user will be allowed to control the sort order of the pinned rows within the pinned container.
We'd like to see the ability to enable a search/filter function for column chooser. One of our applications that uses the RadGridView has dozens of columns, most hidden by default. Our users would like the ability to type in part of a column name and have the column chooser filter on it.
This new API will be useful for implementing custom sorting scenarios when you need to have custom sorting only for a single column. A similar API is available for the filtering functionality (MasterTemplate.DataView.FilterEvaluate)
The new mode should allow copying of single cells even when having the SelectionMode set to FullRowSelect. The attached project features a possible workaround.
I want that the user can select a value from al list like in excel:
Currently, when using the Excel-like filtering and RadListFilterPopup it does not allow filtering by time, only by date:
With releasing .NET 6, there are TimeOnly and DateOnly types which would be more appropriate for managing such values:
https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/
It would be good to add support for these types in GridViewDateTimeView.
Currently, the following code gives an exception when entering edit mode:
public RadForm1()
{
InitializeComponent();
DataTable dt = new DataTable();
dt.Columns.Add("DateOnly", typeof(DateOnly));
dt.Rows.Add(new DateOnly(2022,3,3));
this.radGridView1.AutoGenerateColumns = false;
GridViewDateTimeColumn dateColumn = new GridViewDateTimeColumn();
dateColumn.FieldName = "DateOnly";
this.radGridView1.Columns.Add(dateColumn);
this.radGridView1.DataSource = dt;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
}
Workaround: you can use the following custom TypeConverter:
public RadForm1()
{
InitializeComponent();
DataTable dt = new DataTable();
dt.Columns.Add("DateOnly", typeof(DateOnly));
dt.Rows.Add(new DateOnly(2022,3,3));
this.radGridView1.AutoGenerateColumns = false;
GridViewDateTimeColumn dateColumn = new GridViewDateTimeColumn();
dateColumn.DataType = typeof(DateTime);
dateColumn.FieldName = "DateOnly";
dateColumn.Format = DateTimePickerFormat.Custom;
dateColumn.CustomFormat = "dd/MM/yyyy";
dateColumn.FormatString = "{0:dd/MM/yyyy}";
dateColumn.DataTypeConverter = new DateOnlyConverter();
this.radGridView1.Columns.Add(dateColumn);
this.radGridView1.DataSource = dt;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
}
public class DateOnlyConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(DateTime);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (value is DateOnly && destinationType == typeof(DateTime))
{
DateOnly date = (DateOnly)value;
return new DateTime(date.Year, date.Month, date.Day);
}
return base.ConvertTo(context, culture, value, destinationType);
}
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return sourceType == typeof(DateTime) ;
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is DateTime)
{
DateTime date = (DateTime)value;
return new DateOnly(date.Year, date.Month, date.Day);
}
return base.ConvertFrom(context, culture, value);
}
}
Row reorder feature not work in unbound mode RadGridView with self-reference hierarchy