Unplanned
Last Updated: 06 Feb 2017 09:50 by ADMIN
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.
Unplanned
Last Updated: 06 Feb 2017 09:52 by ADMIN
To reproduce use the attached project. 

Workaround:
Private Sub gvData_UserAddedRow(sender As Object, e As Telerik.WinControls.UI.GridViewRowEventArgs) Handles gvData.UserAddedRow
    Dim pi = GetType(GridViewNewRowInfo).GetProperty("MoveToLastRow", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
    pi.SetValue(Me.gvData.MasterView.TableAddNewRow, True, Nothing)
End Sub
Unplanned
Last Updated: 06 Feb 2017 09:54 by ADMIN
Use the attached project to reproduce.

Workaround:
Set the MaxWidth/MinWidth of the column manually.
Completed
Last Updated: 18 May 2017 13:01 by ADMIN
To reproduce:
- Add default values for all cells in the grid.
- Try to add the new row without changing any value.

Workaround:
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    var editor = radGridView1.ActiveEditor as BaseInputEditor;
    var field = editor.GetType().GetField("originalValue", BindingFlags.NonPublic | BindingFlags.Instance);
    field.SetValue(editor, "asd");
}
Completed
Last Updated: 12 Feb 2018 09:12 by Don
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
Unplanned
Last Updated: 04 Aug 2017 06:00 by ADMIN
Unplanned
Last Updated: 17 Apr 2024 14:41 by ADMIN
To reproduce: please refer to the attached sample project and gif file.

Workaround: use the CellFormatting event and apply the light orange BackColor for the selected cells belonging to the current pinned column:

private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.Row.IsSelected && e.Column.IsCurrent)
    {
        e.CellElement.BackColor = Color.FromArgb(255, 231, 174);
    }
    else
    { 
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
    }
}
Completed
Last Updated: 19 Jun 2017 12:18 by ADMIN
Workaround:

AddHandler Me.RadGridView1.CreateCompositeFilterDialog, AddressOf CreateCompositeFilterDialog

Private Sub CreateCompositeFilterDialog(sender As Object, e As GridViewCreateCompositeFilterDialogEventArgs)
    Dim dialog As New CompositeDataFilterForm()
    AddHandler dialog.DataFilter.EditorRequired, AddressOf EditorRequired
    e.Dialog = dialog
End Sub

Private Sub EditorRequired(sender As Object, e As TreeNodeEditorRequiredEventArgs)
    Dim filterNode As DataFilterCriteriaNode = TryCast(e.Node, DataFilterCriteriaNode)
    If filterNode IsNot Nothing AndAlso filterNode.PropertyName = "BASE_NULL_DATE" AndAlso TypeOf sender Is DataFilterValueEditorElement Then
        e.Editor = New TreeViewDateTimeEditor()
    End If
End Sub
Declined
Last Updated: 17 May 2017 05:15 by ADMIN
To reproduce: please refer to the attached sample project. 

Workaround:   this.radGridView1.TableElement.ScrollToRow(this.radGridView1.RowCount-1);
Unplanned
Last Updated: 19 Jun 2017 11:07 by ADMIN
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;

     }
 }
Completed
Last Updated: 15 Aug 2017 10:54 by ADMIN
Steps to reproduce: 
1. Set DPI scale to 150 of all screens 
2. Run attached sample 
3. The column`s width is not calculated correctly. 
Completed
Last Updated: 03 Jan 2018 06:38 by ADMIN
How to reproduce:
Create a grid with enabled filtering and open the excel-like filter popup of a DateTime column.

Workaround: 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();

        this.radGridView1.EnableFiltering = true;
        this.radGridView1.ShowFilteringRow = true;
        this.radGridView1.ShowHeaderCellButtons = true;
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

        this.radGridView1.FilterPopupInitialized += RadGridView1_FilterPopupInitialized;
    }

    private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
    {
        RadDateFilterPopup popup = e.FilterPopup as RadDateFilterPopup;
        if (popup != null && popup.Width < 300)
        {
            popup.Width += 100;
            popup.Height += 100;
        }
    }

    private object GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Bool", typeof(bool));
        dt.Columns.Add("Date", typeof(DateTime));

        for (int i = 0; i < 100; i++)
        {
            dt.Rows.Add(i, "Name " + i, i % 2 == 0, DateTime.Now.AddDays(1));
        }

        return dt;
    }
}
Completed
Last Updated: 15 Aug 2017 10:54 by ADMIN
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.
Completed
Last Updated: 15 Aug 2017 11:54 by ADMIN
Use attached to reproduce.

Workaround:

class MyViewDefinition : TableViewDefinition
{
    public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
    {
        return new MyTableElement();
    }
}
class MyTableElement : GridTableElement
{
    public override void DpiScaleChanged(SizeF scaleFactor)
    {
        if (this.ViewTemplate != null)
        {
            base.DpiScaleChanged(scaleFactor);
        }

    }
    protected override Type ThemeEffectiveType
    {
        get { return typeof(GridTableElement); }
    }
}

//use the above definition like this:

 radGridView1.ViewDefinition = new MyViewDefinition();
Completed
Last Updated: 15 Aug 2017 11:03 by ADMIN
How to reproduce: Check the attached video --> radgridview-filtering.gif

Workaround:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

        this.radGridView1.EnableFiltering = true;
        this.radGridView1.FilterChanging += RadGridView1_FilterChanging;
        this.radGridView1.FilterChanged += RadGridView1_FilterChanged;
    }

    private void RadGridView1_FilterChanged(object sender, GridViewCollectionChangedEventArgs e)
    {
        if (clearFiler)
        {
            this.radGridView1.FilterDescriptors.Remove((FilterDescriptor)e.NewItems[0]);
            clearFiler = false;
        }
    }

    bool clearFiler = false;
    private void RadGridView1_FilterChanging(object sender, GridViewCollectionChangingEventArgs e)
    {
        if (e.PropertyName == "Operator" && e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.ItemChanging)
        {
            FilterDescriptor fd = e.OldItems[0] as FilterDescriptor;
            if (fd != null && (fd.Operator == FilterOperator.IsNull || fd.Operator == FilterOperator.IsNotNull))
            {
                clearFiler = true;
            }
        }
    }
    private object GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));

        for (int i = 0; i < 100; i++)
        {
            dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
        }

        return dt;
    }
}
Completed
Last Updated: 15 Aug 2017 11:03 by ADMIN
To reproduce:
1. Filter the first column in the grid
2. Click the header checkbox
3. Try to clear the filter. you iwll notice that the data is still filtered.

Workaround:

private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType==typeof(GridCheckBoxHeaderCellElement))
    {
        e.CellElement = new CustomHeaderCell(e.Column, e.Row);
    }
}

public class CustomHeaderCell : GridCheckBoxHeaderCellElement
{

    public CustomHeaderCell(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

    protected override void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args)
    {
        base.checkbox_ToggleStateChanged(sender, args);
        this.TableElement.EndUpdate(false);
    }
}

Completed
Last Updated: 15 Aug 2017 11:03 by Chris
Created by: Matt
Comments: 2
Category: GridView
Type: Feature Request
2
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.
Completed
Last Updated: 22 Dec 2017 14:00 by ADMIN
How to reproduce: 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.EnableFiltering = true;
        this.radGridView1.ShowHeaderCellButtons = true;

        this.radGridView1.FilterPopupRequired += RadGridView1_FilterPopupRequired;

        GridViewDateTimeColumn date = this.radGridView1.Columns["Date"] as GridViewDateTimeColumn;
        date.DataType = typeof(DateTime);
        date.FilteringMode = GridViewTimeFilteringMode.Date;
    }

    private void RadGridView1_FilterPopupRequired(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e)
    {
        if (e.Column.GetType().Name == "GridViewDateTimeColumn")
        {
            RadListFilterPopup popup = new RadListFilterPopup(e.Column, true);
            e.FilterPopup = popup;
        }
    }

    private object GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));

        DateTime date = DateTime.Now;
        for (int i = 0; i < 1500; i++)
        {
            dt.Rows.Add(i, "Name " + i, date.AddDays(i), i % 2 == 0);
        }

        return dt;
    }

Workaround: custom RadListFilterPopup

public class MyRadListFilterPopup : RadListFilterPopup
{
    public MyRadListFilterPopup(GridViewDataColumn dataColumn, bool groupedDateValues)
        : base(dataColumn, groupedDateValues)
    { }

    protected override void OnButtonOkClick(EventArgs e)
    {
        FilterOperator filterOperator = FilterOperator.IsEqualTo;

        IRadListFilterElement listFilterElement = typeof(RadListFilterPopup).GetField("listFilterElement", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).
            GetValue(this) as IRadListFilterElement;

        switch (listFilterElement.SelectedMode)
        {
            case ListFilterSelectedMode.All:
                filterOperator = FilterOperator.None;
                break;
            case ListFilterSelectedMode.Null:
                filterOperator = FilterOperator.IsNull;
                break;
            case ListFilterSelectedMode.NotNull:
                filterOperator = FilterOperator.IsNotNull;
                break;
        }

        if (filterOperator != FilterOperator.IsEqualTo)
        {
            SetFilterOperator(filterOperator);
            this.ClosePopup(RadPopupCloseReason.CloseCalled);
        }
        else
        {
            CompositeFilterDescriptor compositeFilterDescriptor = new CompositeFilterDescriptor();
            compositeFilterDescriptor.PropertyName = base.DataColumn.Name;
            compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or;

            foreach (DictionaryEntry entry in listFilterElement.SelectedValues)
            {
                foreach (object value in (ArrayList)entry.Value)
                {
                    FilterDescriptor descriptor;
                    if (base.DataColumn is GridViewDateTimeColumn || base.DataColumn.DataType == typeof(DateTime) ||
                        base.DataColumn.DataType == typeof(DateTime?))
                    {
                        descriptor = new DateFilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, (DateTime?)value, false);
                    }
                    else
                    {
                        descriptor = new FilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, value);
                    }
                    compositeFilterDescriptor.FilterDescriptors.Add(descriptor);
                }
            }

            base.FilterDescriptor = compositeFilterDescriptor;
            OnFilterConfirmed();
        }
    }
}
Completed
Last Updated: 15 Aug 2017 11:03 by ADMIN
How to reproduce:
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            this.radGridView1.DataSource = this.GetData();
            GridViewComboBoxColumn supplierColumn = new GridViewComboBoxColumn();
            supplierColumn.Name = "SupplierColumn";
            supplierColumn.HeaderText = "Supplier";
            supplierColumn.DataSource = this.GetListItemData(); ;
            supplierColumn.ValueMember = "Id";
            supplierColumn.DisplayMember = "Description";
            supplierColumn.Width = 200;
            this.radGridView1.Columns.Add(supplierColumn);
            this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            this.radGridView1.CellEditorInitialized += RadGridView1_CellEditorInitialized;
        }

        private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
            if (editor == null)
            {
                return;
            }

            RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;
            element.ValueChanging -= Element_ValueChanging;
            element.ValueChanging += Element_ValueChanging;
        }

        private void Element_ValueChanging(object sender, ValueChangingEventArgs e)
        {
            Console.WriteLine("ValueChanging");
            Console.WriteLine("Old " + e.OldValue);
            Console.WriteLine("New " + e.NewValue);
        }

        private object GetData()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Date", typeof(DateTime));

            for (int i = 0; i < 100; i++)
            {
                dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i));
            }

            return dt;
        }

        public List<Item> GetListItemData()
        {
            List<Item> items = new List<Item>();
            for (int i = 0; i < 10; i++)
            {
                items.Add(new Item(i, "Data" + i, DateTime.Now.AddDays(i).AddHours(i)));
            }

            return items;
        }
    }

    public class Item
    {
        public int Id { get; set; }

        public string Description { get; set; }

        public DateTime Date { get; set; }

        public Item(int id, string description, DateTime date)
        {
            this.Id = id;
            this.Description = description;
            this.Date = date;
        }
    }

Workaround: handle the TextChanging event and store locally the old value
 private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
 {
     RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
     if (editor == null)
     {
         return;
     }

     RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;

     element.TextChanging-= Element_TextChanging;
     element.TextChanging += Element_TextChanging;
     element.ValueChanging -= Element_ValueChanging;
     element.ValueChanging += Element_ValueChanging;
 }

 object oldValue;
 private void Element_TextChanging(object sender, TextChangingEventArgs e)
 {
     oldValue = e.OldValue;
 }

 private void Element_ValueChanging(object sender, ValueChangingEventArgs e)
 {
     Console.WriteLine("ValueChanging");
     Console.WriteLine("Old " + oldValue);
     Console.WriteLine("New " + e.NewValue);
 }