The selection mode should be as in Windows Explorer - when Control is pressed, one should be able to move the current row with the up/down arrow keys and when Space is pressed, the current row should be selected/deselected.
This implementation can be used for the time being:
public partial class Form1 : RadForm
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
AddGridSimpleUnbound();
radGridView1.MultiSelect = true;
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new MyRowBehavior());
radGridView1.GridViewElement.Navigator = new MyNavigator();
}
class MyNavigator : BaseGridNavigator
{
protected override bool DoMultiSelect(GridViewRowInfo oldRow, GridViewColumn oldColumn, GridViewRowInfo row, GridViewColumn column)
{
if (!this.IsShiftButtonPressed && this.IsControlButtonPressed && !this.IsMouseSelection)
{
return true;
}
return base.DoMultiSelect(oldRow, oldColumn, row, column);
}
}
class MyRowBehavior : GridDataRowBehavior
{
bool kbdSelection = false;
public override bool ProcessKeyPress(KeyPressEventArgs keys)
{
if (kbdSelection)
{
kbdSelection = false;
return true;
}
return base.ProcessKeyPress(keys);
}
public override bool ProcessKey(KeyEventArgs keys)
{
if (keys.KeyCode == Keys.Space && this.GridControl.MultiSelect && keys.Control)
{
this.GridControl.CurrentRow.IsSelected ^= true;
kbdSelection = true;
return false;
}
else
{
return base.ProcessKey(keys);
}
}
}
}
Similar property is already available in the property grid and tree view exporters.
To reproduce:
Sub New()
InitializeComponent()
Dim items As New List(Of WorkOrder)
For index = 1 To 56
items.Add(New WorkOrder(index, "Item" & index, 0))
Next
Dim rand As New Random
For index = 57 To 500
items.Add(New WorkOrder(index, "Item" & index, rand.Next(1, 56)))
Next
Me.RadGridView1.Relations.AddSelfReference(Me.RadGridView1.MasterTemplate, "Id", "ParentId")
Me.RadGridView1.DataSource = items
Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
Me.RadGridView1.EnablePaging = True
Me.RadGridView1.PageSize = 20
End Sub
Public Class WorkOrder
Private _id As Integer
Private _name As String
Private _parentId As Integer
Public Sub New(id As Integer, name As String, parentId As Integer)
Me._id = id
Me._name = name
Me._parentId = parentId
End Sub
Public Property Id() As String
Get
Return _id
End Get
Set(ByVal value As String)
_id = value
End Set
End Property
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property ParentID() As Integer
Get
Return _parentId
End Get
Set(ByVal value As Integer)
_parentId = value
End Set
End Property
End Class
Workaround: use standard hierarchy: http://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/hierarchy-of-one-to-many-relations
Example : if we have 5 rows in the grid and if we copy 10 rows from excel and paste in first row, only first 5 records gets pasted and remaining 5 would be ignored.
It would be great if multi-page printing is supported for grids with ColumnGroupsViewDefinition and HtmlViewDefinition.
RadGridView, TextBoxColumn - add support for autocomplete.
There should be a way to fix the width of certain columns. Their width should remain the same while resizing the grid.
One should be able to create a relation in order to produce the following hierarchy:
public class MainObject
{
public ObservableCollection<LibraryObject> ListOfLibraryObjects { get; set; }
}
public class LibraryObject
{
public string LibraryName { get; set; }
public TrajectoryManager TheTrajectoryManager { get; set; }
}
public class TrajectoryManager
{
public ObservableCollection<TrajectoryData> ListOfTrajectoryData { get; set; }
}
public class TrajectoryData
{
public string Name { get; set; }
}
WORKAROUND:
public class MainObject
{
public ObservableCollection<LibraryObject> ListOfLibraryObjects;
}
public class LibraryObject
{
public string LibraryName { get; set; }
public ObservableCollection<TrajectoryData> ListOfTrajectoryData { get; set; }
// public TrajectoryManager TheTrajectoryManager;
//}
//public class TrajectoryManager
//{
// public ObservableCollection<TrajectoryData> ListOfTrajectoryData;
}
public class TrajectoryData
{
public string Name { get; set; }
}
Improve editors in RadGridView by allowing clipping when the control is scrolled.
ADD. RadGridView - add AutoSizeRows functionality in HtmlViewDefinition
Improve RadGridView API by allowing user to set styles for all rows and columns through styles as Microsoft DataGridView. Expose the following properties: - ColumnHeadersDefaultCellStyle - RowHeadersDefaultCellStyle - RowsDefaultCellStyle - DefaultCellStyle
Currently exporters do not respect the RightToLeft property of RadGridView and export the data always as left to right.
Add a TextAlignment property of GridViewSummaryItem.
When the pencil icon is clicked the RowValidating event must be fired.
WORKAROUND:
1. When clicking the "pencil" icon, the current row is not changed, thus the RowValidating is not fired. A suitable event to cover this case is the CellValidating event which will be triggered when the "pencil" icon is clicked.
2. When the pencil is clicked, save the grid's CurrentRow, set it to null and then set it back to the saved row. This will trigger the RowValidating event and the desired logic will be executed. The downside of this approach is that the event will be triggered twice, because we change the CurrentRow twice.
void radGridView1_MouseDown(object sender, MouseEventArgs e)
{
GridRowHeaderCellElement rowHeader = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridRowHeaderCellElement;
if (rowHeader != null)
{
GridViewRowInfo saveRow = radGridView1.CurrentRow;
radGridView1.CurrentRow = null;
radGridView1.CurrentRow = saveRow;
}
}
The cell BorderLeftShadowColor, BorderRightShadowColor, BorderTopShadowColor, BorderBottomShadowColor cannot be styled through a GridViewCellStyle object.
change the localization provider for one gridview only (e.g. we have multiple different grids in our application, but I want to apply that custom RadGridLocalizationProvider selectively to only few of them)