Completed
Last Updated: 04 Jan 2017 19:15 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 16 Dec 2016 12:41
Category: VirtualGrid
Type: Bug Report
1
FIX. RadVirtualGrid - after unpinning a column it is not displayed in the grid
To reproduce: use the following code snippet and follow the steps:
public RadForm1()
{
    InitializeComponent();

    this.radVirtualGrid1.RowCount = 10;
    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.CellValueNeeded+=radVirtualGrid1_CellValueNeeded;
}

private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = e.RowIndex + "." + e.ColumnIndex;
}

1. Pin (left or right) 1st column
2. Scroll horizontally (to not display 2nd column)
3. Unpin 1st column
4. Scroll horizontally to display 1st column
=> 1st column is hidden, the only way to make it visible is to resize a column or the entire window

Workaround: 

 private void radVirtualGrid1_ContextMenuOpening(object sender, Telerik.WinControls.UI.VirtualGridContextMenuOpeningEventArgs e)
 {
     foreach (RadItem item in e.ContextMenu.Items)
     {
         if (item.Text == 
             RadVirtualGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadVirtualGridStringId.PinMenuItem))
         {
             foreach (RadMenuItem subItem in ((RadMenuItem)item).Items)
             {
                 if (subItem.Text == 
                     RadVirtualGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadVirtualGridStringId.UnpinColumnMenuItem))
                 {
                     subItem.Click-=subItem_Click;
                     subItem.Click+=subItem_Click;
                 }
             }
         }
     }
 }

 private void subItem_Click(object sender, EventArgs e)
 {
      this.radVirtualGrid1.MasterViewInfo.SetColumnWidth(0, this.radVirtualGrid1.MasterViewInfo.GetColumnWidth(0));
 }
Attached Files:
0 comments