Completed
Last Updated: 18 Jan 2019 15:14 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 11 Dec 2018 10:22
Category: VirtualGrid
Type: Bug Report
1
FIX.RadVirtualGrid - expander icon is not correct when you expand/collapse a row
To reproduce: open the Demo application >> VirtualGrid >> First Look example. Follow the steps illustrated in the attached gif file. You will notice that when you expand a row, the "-" sign is show for a second and then it is returned to "+" although the row is still expanded. 

Workaround:
            this.radVirtualGrid1.CellFormatting += radVirtualGrid1_CellFormatting;
            this.radVirtualGrid1.RowExpanded += radVirtualGrid1_RowExpanded;
            this.radVirtualGrid1.RowCollapsed += radVirtualGrid1_RowCollapsed;



        private void radVirtualGrid1_RowCollapsed(object sender, VirtualGridRowExpandedEventArgs e)
        {
            if (expandedState.ContainsKey(e.RowIndex))
            {
                expandedState[e.RowIndex] = !expandedState[e.RowIndex];
            }
           
            this.radVirtualGrid1.TableElement.SynchronizeRow(e.RowIndex, true);
        }

        Dictionary<int, bool> expandedState = new Dictionary<int, bool>();

        private void radVirtualGrid1_RowExpanded(object sender, VirtualGridRowExpandedEventArgs e)
        {
            if (!expandedState.ContainsKey(e.RowIndex))
            {
                expandedState.Add(e.RowIndex, false);
            }
            expandedState[e.RowIndex] = !expandedState[e.RowIndex];
            this.radVirtualGrid1.TableElement.SynchronizeRow(e.RowIndex, true);
        }

        private void radVirtualGrid1_CellFormatting(object sender, Telerik.WinControls.UI.VirtualGridCellElementEventArgs e)
        {
            VirtualGridIndentCellElement indentCell = e.CellElement as VirtualGridIndentCellElement;
            if (indentCell != null)
            {
                if (expandedState.ContainsKey(e.CellElement.RowIndex) && expandedState[e.CellElement.RowIndex] == true)
                {
                    indentCell.ExpanderItem.SignImage = Properties.Resources.chevron_up;
                }
                else
                {
                    indentCell.ExpanderItem.SignImage = Properties.Resources.chevron_down;
                }
            }

        }
Attached Files:
1 comment
ADMIN
Dimitar
Posted on: 18 Jan 2019 15:14
Fixed in Telerik UI for WinForms version R1 2019.