To reproduce:
- Add self-reference hierarchy and set a checkbox column as expander column - show the column at runtime upon button click.
- You will notice that the layout is not updated properly.
- If the column is small the checkboxes appear in the next cell.
Workaround:
Update the layout when the column is made visible:
this.gridViewParameter.TableElement.UpdateView();
Set the ClipDrawing property of the checkbox cells to true:
void gridViewParameter_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridCheckBoxCellElement)
{
e.CellElement.ClipDrawing = true;
}
else
{
e.CellElement.ResetValue(LightVisualElement.ClipDrawingProperty, Telerik.WinControls.ValueResetFlags.Local);
}
}
How to reproduce: Create a grid in self referencing hierarchy and set up a filter expression like this: this.radGridView1.FilterDescriptors.Expression = "Name = \"bin\" AND (FileSystemInfoType = \"Folder\" OR Id = \"2\")" Immediately after the expression is set, the OR logical operator is substituted with AND
workaround: in the handler of the Load event explicitly set the scroll bar value to 0 this.radGridView1.TableElement.VScrollBar.Value = 0;
How to reproduce:
public Form1()
{
InitializeComponent();
string newLine = "line";
string multiLine = "line";
for (int i = 0; i < 10; i++)
{
radGridView1.Rows.Add(newLine, multiLine);
multiLine += Environment.NewLine + multiLine;
}
this.Load += Form1_Load;
}
Workaround:
private void Form1_Load(object sender, EventArgs e)
{
this.radGridView1.Columns[1].PropertyChanged += item_PropertyChanged;
}
private void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "IsVisible")
{
this.radGridView1.TableElement.ScrollTo(0, 0);
}
}
To reproduce:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CustomersTableAdapter.Fill(Me.NwindDataSet.Customers)
Me.RadGridView1.DataSource = Me.CustomersBindingSource
Dim view As New ColumnGroupsViewDefinition()
view.ColumnGroups.Add(New GridViewColumnGroup("Customer Contact"))
view.ColumnGroups.Add(New GridViewColumnGroup("Details"))
view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Address"))
view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Contact"))
view.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow())
view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("CompanyName"))
view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("ContactName"))
view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("ContactTitle"))
view.ColumnGroups(1).Groups(0).Rows.Add(New GridViewColumnGroupRow())
view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("Address"))
view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("City"))
view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("Country"))
view.ColumnGroups(1).Groups(1).Rows.Add(New GridViewColumnGroupRow())
view.ColumnGroups(1).Groups(1).Rows(0).Columns.Add(Me.RadGridView1.Columns("Phone"))
view.ColumnGroups(1).Groups(1).Rows(0).Columns.Add(Me.RadGridView1.Columns("Fax"))
RadGridView1.ViewDefinition = view
RadGridView1.BestFitColumns(BestFitColumnMode.AllCells)
End Sub
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
Dim spreadExporter As New GridViewSpreadExport(RadGridView1)
Dim fileName As String = "..\..\exported.xlsx"
Dim exportRenderer As New SpreadExportRenderer()
spreadExporter.SheetName = "Sheet1"
spreadExporter.ExportVisualSettings = True
spreadExporter.SummariesExportOption = SummariesOption.ExportOnlyTop
spreadExporter.SheetMaxRows = ExcelMaxRows._1048576
spreadExporter.HiddenColumnOption = HiddenOption.DoNotExport
spreadExporter.HiddenRowOption = HiddenOption.DoNotExport
spreadExporter.FileExportMode = FileExportMode.CreateOrOverrideFile
spreadExporter.RunExport(fileName, exportRenderer)
Process.Start(fileName)
End Sub
Workaround: by using the SpreadExportRenderer.WorkbookCreated event you can remove the header cells and add new ones in order to display the same header layout as in the grid:
http://www.telerik.com/help/winforms/gridview-exporting-data-spread-export.html
http://www.telerik.com/help/winforms/spreadprocessing-working-with-cells-insert-remove-cells.html
http://www.telerik.com/blogs/getting-started-with-radspreadprocessing-volume-1
“Missing data after apply Object-Relational filtering operation” as in the attached, also capture case simulation in video file to illustrate how the case happen to support your investigation. Scenario case: · Expand Parent Data 2 à will see child data level (child data 2.1.1, child data 2.1.2, child data 2.1.3) · Filter child data that contains value = input “2.1.4” (mismatch case filter)· Current Result : Not show all 3 child data and cannot get it back to display again In this case, normally how the component handle this “not found filtering result” case, is it normal to display result like this? If so please help recommend how we can get 3 child data back for doing any further process.
To reproduce: 1. Add a grid to a form. 2. Set its SplitMode to vertical or horizontal. 3. Set its SynchronizeCurrentRowInSplitMode to false. You will notice that both grids are synchronized. Workaround: Add two RadgridViews in a RadSplitContainer with two split panels and use two separate data sources. For example: List<string> ds = new List<string>(); grid1.DataSource = ds; grid2.DataSource = ds.ToArray();
To reproduce: - Add two child templates to a grid. - Add summary rows to both of them - Change the value of the child template. Workaround: - Clear and add back the summary rows when a value in the child template is changed.
Workaround, use the Pasting event of RadGridView and perform the needed validation
To reproduce:
radGridView1.DataSource = GetTable();
radGridView1.MultiSelect = true;
radGridView1.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect;
Then just select and deselect several cells without releasing the mouse button.
Workaround:
void radGridView1_MouseUp(object sender, MouseEventArgs e)
{
int endIndexCol = -1;
int endIndexRow = -1;
GridDataCellElement curentCell = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridDataCellElement;
if (curentCell != null)
{
endIndexCol = curentCell.ColumnInfo.Index;
endIndexRow = curentCell.RowInfo.Index;
}
if (endIndexCol < startIndexCol)
{
int temp = endIndexCol;
endIndexCol = startIndexCol;
startIndexCol = temp;
}
if (endIndexRow < startIndexRow)
{
int temp = endIndexRow;
endIndexRow = startIndexRow;
startIndexRow = temp;
}
foreach (GridViewCellInfo cell in radGridView1.SelectedCells.ToList())
{
if (cell.RowInfo.Index < startIndexRow || cell.RowInfo.Index > endIndexRow)
{
cell.IsSelected = false;
}
if (cell.ColumnInfo.Index < startIndexCol || cell.ColumnInfo.Index > endIndexCol)
{
cell.IsSelected = false;
}
}
}
int startIndexCol = -1 ;
int startIndexRow = -1;
void radGridView1_MouseDown(object sender, MouseEventArgs e)
{
GridDataCellElement curentCell = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridDataCellElement;
if (curentCell != null)
{
startIndexCol = curentCell.ColumnInfo.Index;
startIndexRow = curentCell.RowInfo.Index;
}
}
The issue is reproduced when the columns for GridViewTemplate are added last in the end after the all hierarchy settings: relations, templates
Workaround: set the Position of the current item of the BindingSource in the CurrentRowChanged event of RadGridView:
void rgvInvoices_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
{
int index = bsInvoices.IndexOf(e.CurrentRow.DataBoundItem) ;
bsInvoices.Position = index;
}
Description: CustomFiltering event does not fire for a RadGridView with Self-Referencing Hierarchy To reproduce: - add RadGridView to a form - EnableCustomFiltering=true and EnableFiltering=true - AddSelfReference Workaround: - First AddSelfReference and bind the grid - Second EnableCustomFiltering=true and EnableFiltering=true
Workaround: handle the KeyDown event of the inner TextBoxControl and manipulate the TextBox.SelectionStart:
private void radPropertyGrid1_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
{
PropertyGridDropDownListEditor ddlEditor = e.Editor as PropertyGridDropDownListEditor;
if (ddlEditor != null)
{
ddlEditor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
BaseDropDownListEditorElement el = ddlEditor.EditorElement as BaseDropDownListEditorElement;
el.EditableElement.TextBox.TextBoxItem.TextBoxControl.KeyDown -= el_KeyDown;
el.EditableElement.TextBox.TextBoxItem.TextBoxControl.KeyDown += el_KeyDown;
}
}
private void el_KeyDown(object sender, KeyEventArgs e)
{
TextBox tb = sender as TextBox;
if (e.KeyData == Keys.Left && tb.SelectionStart > 0)
{
tb.SelectionStart = --tb.SelectionStart;
}
if (e.KeyData == Keys.Right && tb.SelectionStart <= tb.Text.Length)
{
tb.SelectionStart = ++tb.SelectionStart;
}
}
1. Create new project with RadGridView and setup hierarchy with multiple tabs.
2. Run the project.
3. Open a child view tab and start editing a filter cell.
4. While the editor is open, change the active tab.
5. Repeat this operation several times.
Workaround: the issue appears because RadGridView does not close its editor when changing the tab page and it thinks that it is still in edit mode when selecting the old page. You can work around the issue by using a custom cell element. Consider the code below:
public class CustomDetailsCellElement : GridDetailViewCellElement
{
public CustomDetailsCellElement(GridViewColumn column, GridRowElement row)
: base(column, row)
{
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(GridDetailViewCellElement);
}
}
protected override RadPageViewElement CreatePageViewElement(IRadPageViewProvider pageViewProvider)
{
RadPageViewElement pageView = base.CreatePageViewElement(pageViewProvider);
pageView.ItemSelecting += new EventHandler<RadPageViewItemSelectingEventArgs>(PageViewElement_ItemSelecting);
return pageView;
}
void PageViewElement_ItemSelecting(object sender, RadPageViewItemSelectingEventArgs e)
{
if (this.IsInValidState(true) && this.GridControl != null && this.GridControl.IsInEditMode)
{
this.GridControl.EndEdit();
}
}
}
You should handle also the CreateCell event in order to replace default child view cell in RadGridView:
void gvReviewMigration_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
if (e.CellType == typeof(GridDetailViewCellElement))
{
e.CellType = typeof(CustomDetailsCellElement);
}
}
When selecting the child templates from the tree view in the left pane, the preview should be updated to show the child template.
http://screencast.com/t/mZDwbWS8 WORKAROUND: Set the UseCompatibleTextRendering property of RadGridView to false.