To reproduce:
Generate the hierarchy with the following code:
radGridView1.SelectionMode = GridViewSelectionMode.CellSelect;
radGridView1.MultiSelect = true;
radGridView1.ClipboardCopyMode = GridViewClipboardCopyMode.EnableWithoutHeaderText;
radGridView1.ClipboardPasteMode = GridViewClipboardPasteMode.Enable;
radGridView1.AutoGenerateColumns = true;
radGridView1.CellValueChanged += grid_CellValueChanged;
//radGridView1.ViewCellFormatting += GridCellFormatting;
//radGridView1.RowFormatting += grid_RowFormatting;
radGridView1.EnableSorting = true;
//radGridView1.MasterTemplate.EnableCustomSorting = true;
radGridView1.AllowMultiColumnSorting = true;
radGridView1.ShowGroupPanel = true;
radGridView1.EnableFiltering = true;
radGridView1.ShowFilteringRow = false;
radGridView1.MasterTemplate.ShowHeaderCellButtons = true;
DataTable dt1 = new DataTable();
dt1.Columns.Add("Column1");
dt1.Columns.Add("Column2");
dt1.Columns.Add("Column3");
dt1.Columns.Add("Column4");
dt1.Columns.Add("Column5");
dt1.Columns.Add("Column6");
dt1.Columns.Add("Column7");
dt1.Columns.Add("Column8");
dt1.Columns.Add("Column9");
dt1.Columns.Add("Column10");
DataTable dt2 = new DataTable();
dt2.Columns.Add("Column1");
dt2.Columns.Add("Column2");
dt2.Columns.Add("Column3");
dt2.Columns.Add("Column4");
dt2.Columns.Add("Column5");
dt2.Columns.Add("Column6");
dt2.Columns.Add("Column7");
dt2.Columns.Add("Column8");
dt2.Columns.Add("Column9");
var temp = new GridViewTemplate();
temp.AutoGenerateColumns = true;
radGridView1.Templates.Add(temp);
var rel = new GridViewRelation(radGridView1.MasterTemplate, temp);
rel.ChildColumnNames.Add("Column1");
rel.ParentColumnNames.Add("Column1");
radGridView1.Relations.Add(rel);
radGridView1.MasterTemplate.DataSource = dt1;
dt1.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(3, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(4, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(5, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
temp.DataSource = dt2;
1. Run the project with the generated hierarchy
2. Select second cell in first row.
3. Expand first row and select 3 cells in fifth column by mouse drag
4. Right click on selection and "Copy" or press Ctrl+C.
5. Try to Paste the data into 7-th column.
6. The data is pasted in the second column
To reproduce:
Generate the hierarchy with the following code:
radGridView1.SelectionMode = GridViewSelectionMode.CellSelect;
radGridView1.MultiSelect = true;
radGridView1.ClipboardCopyMode = GridViewClipboardCopyMode.EnableWithoutHeaderText;
radGridView1.ClipboardPasteMode = GridViewClipboardPasteMode.Enable;
radGridView1.AutoGenerateColumns = true;
radGridView1.CellValueChanged += grid_CellValueChanged;
//radGridView1.ViewCellFormatting += GridCellFormatting;
//radGridView1.RowFormatting += grid_RowFormatting;
radGridView1.EnableSorting = true;
//radGridView1.MasterTemplate.EnableCustomSorting = true;
radGridView1.AllowMultiColumnSorting = true;
radGridView1.ShowGroupPanel = true;
radGridView1.EnableFiltering = true;
radGridView1.ShowFilteringRow = false;
radGridView1.MasterTemplate.ShowHeaderCellButtons = true;
DataTable dt1 = new DataTable();
dt1.Columns.Add("Column1");
dt1.Columns.Add("Column2");
dt1.Columns.Add("Column3");
dt1.Columns.Add("Column4");
dt1.Columns.Add("Column5");
dt1.Columns.Add("Column6");
dt1.Columns.Add("Column7");
dt1.Columns.Add("Column8");
dt1.Columns.Add("Column9");
dt1.Columns.Add("Column10");
DataTable dt2 = new DataTable();
dt2.Columns.Add("Column1");
dt2.Columns.Add("Column2");
dt2.Columns.Add("Column3");
dt2.Columns.Add("Column4");
dt2.Columns.Add("Column5");
dt2.Columns.Add("Column6");
dt2.Columns.Add("Column7");
dt2.Columns.Add("Column8");
dt2.Columns.Add("Column9");
var temp = new GridViewTemplate();
temp.AutoGenerateColumns = true;
radGridView1.Templates.Add(temp);
var rel = new GridViewRelation(radGridView1.MasterTemplate, temp);
rel.ChildColumnNames.Add("Column1");
rel.ParentColumnNames.Add("Column1");
radGridView1.Relations.Add(rel);
radGridView1.MasterTemplate.DataSource = dt1;
dt1.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(3, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(4, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(5, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
temp.DataSource = dt2;
1. Run the project with the generated hierarchy
2. Select Last cell in first row. (there is no "Column9" in Child Template)
3. Expand first row and select any cell in first child row.
4. Hold Shift-Key and press down arrow or up arrow until you receive a NullReferenceException.
To reproduce:
- generate the hierarchy using the following code:
radGridView1.SelectionMode = GridViewSelectionMode.CellSelect;
radGridView1.MultiSelect = true;
radGridView1.ClipboardCopyMode = GridViewClipboardCopyMode.EnableWithoutHeaderText;
radGridView1.ClipboardPasteMode = GridViewClipboardPasteMode.Enable;
radGridView1.AutoGenerateColumns = true;
radGridView1.CellValueChanged += grid_CellValueChanged;
radGridView1.EnableSorting = true;
radGridView1.AllowMultiColumnSorting = true;
radGridView1.ShowGroupPanel = true;
radGridView1.EnableFiltering = true;
radGridView1.ShowFilteringRow = false;
radGridView1.MasterTemplate.ShowHeaderCellButtons = true;
DataTable dt1 = new DataTable();
DataTable dt2 = new DataTable();
for (int i = 0; i < 10; i++)
{
dt1.Columns.Add("Column" + i);
dt2.Columns.Add("Column" + i);
}
var temp = new GridViewTemplate();
temp.AutoGenerateColumns = true;
radGridView1.Templates.Add(temp);
var rel = new GridViewRelation(radGridView1.MasterTemplate, temp);
rel.ChildColumnNames.Add("Column1");
rel.ParentColumnNames.Add("Column1");
radGridView1.Relations.Add(rel);
radGridView1.MasterTemplate.DataSource = dt1;
dt1.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(3, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(4, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt1.Rows.Add(5, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6, 9);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(1, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
dt2.Rows.Add(2, "sdf", "sdfsfqwert", 1, 2, 3, 4, 7, 6);
temp.DataSource = dt2;
1. Run the project with the generated hierarchy
2. Select second cell in first row.
3. Expand first row and select fifth cell in first child row.
4. Hold Shift-Key and press down arrow after that right arrow twice.
selection will be incorrect
Description: When we scroll the RadGridView from Top to Bottom and Bottom to Top the first record is cut off, if we click the refresh button then it will be displayed properly.
To reproduce:
- add a RadGridView to a form
- add a RadButton to a form
- use the following code snippet:
public Form1()
{
InitializeComponent();
radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
radGridView1.EnableCustomFiltering = false;
this.radGridView1.AutoSizeRows = true;
radGridView1.Columns["CustomerID"].Width = 100;
radGridView1.Columns["CompanyName"].Width = 150;
radGridView1.Columns["ContactName"].Width = 150;
radGridView1.Columns["Country"].Width = 100;
radGridView1.Columns["Phone"].Width = 90;
radGridView1.Columns["Fax"].Width = 90;
radGridView1.Columns["Phone"].AllowFiltering = false;
radGridView1.Columns["Fax"].AllowFiltering = false;
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
}
private void radButton1_Click(object sender, EventArgs e)
{
Form1_Load(sender, e);
}
To reproduce:
radChartView1 = new RadChartView();
radChartView1.Parent = this;
radChartView1.Dock = DockStyle.Fill;
radChartView1.ShowGrid = true;
CartesianGrid grid = ((CartesianGrid)radChartView1.GetArea<CartesianArea>().Grid);
grid.DrawVerticalFills = true;
grid.AlternatingHorizontalColor = false;
grid.AlternatingVerticalColor = false;
grid.BackColor = Color.Red;
grid.ForeColor = Color.Blue;
grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
DateTimeContinuousAxis horizontalAxis = new DateTimeContinuousAxis();
horizontalAxis.MajorStepUnit = Telerik.Charting.TimeInterval.Day;
horizontalAxis.MajorStep = 2;
horizontalAxis.LabelFormat = "{0:dd/MM/yyyy}";
LinearAxis verticalAxis1 = new LinearAxis();
verticalAxis1.AxisType = AxisType.Second;
LinearAxis verticalAxis2 = new LinearAxis();
verticalAxis2.AxisType = AxisType.Second;
verticalAxis2.HorizontalLocation = AxisHorizontalLocation.Right;
LineSeries line1 = new LineSeries();
line1.HorizontalAxis = horizontalAxis;
line1.VerticalAxis = verticalAxis1;
LineSeries line2 = new LineSeries();
line2.HorizontalAxis = horizontalAxis;
line2.VerticalAxis = verticalAxis2;
line1.DataPoints.Add(new CategoricalDataPoint(26d, DateTime.Now.AddDays(-6)));
line1.DataPoints.Add(new CategoricalDataPoint(20d, DateTime.Now.AddDays(-5)));
line1.DataPoints.Add(new CategoricalDataPoint(12d, DateTime.Now.AddDays(-4)));
line1.DataPoints.Add(new CategoricalDataPoint(15d, DateTime.Now.AddDays(-2)));
line1.DataPoints.Add(new CategoricalDataPoint(21d, DateTime.Now.AddDays(-1)));
line2.DataPoints.Add(new CategoricalDataPoint(32d, DateTime.Now.AddDays(-6)));
line2.DataPoints.Add(new CategoricalDataPoint(52d, DateTime.Now.AddDays(-4)));
line2.DataPoints.Add(new CategoricalDataPoint(35d, DateTime.Now.AddDays(-3)));
line2.DataPoints.Add(new CategoricalDataPoint(36d, DateTime.Now.AddDays(-2)));
line2.DataPoints.Add(new CategoricalDataPoint(11d, DateTime.Now.AddDays(-1)));
this.radChartView1.Series.Add(line1);
this.radChartView1.Series.Add(line2);
Workaround - no
To reproduce
- add Calculator column in the grid
- set the EnterKeyMode to EnterMovesToNextRow
- press enter when the cell is in edit mode.
Workaround:
-use custom GridDataRowBehavior like this:
class MyNewEnterBehavior : GridDataRowBehavior
{
bool firstTime = true;
protected override bool ProcessEnterKey(KeyEventArgs keys)
{
if (this.GridControl.IsInEditMode && this.GridControl.CurrentColumn is GridViewCalculatorColumn )
{
if (firstTime)
{
firstTime = false;
return false;
}
firstTime = true;
return base.ProcessEnterKey(keys);
}
return base.ProcessEnterKey(keys);
}
}
To repriduce:
- Add a grid with Office2007Theme applied and sort by one of the columns
- Set RightToLeft to true
- Make sure the column width is no wider than the text
Workaround:
void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
GridHeaderCellElement headerCell = e.CellElement as GridHeaderCellElement;
if (headerCell != null)
{
if (radGridView1.ThemeName == "Office2007Silver" && e.Column.IsSorted)
{
headerCell.Arrow.Alignment = ContentAlignment.TopCenter;
headerCell.Arrow.Margin = new Padding(0, 1, 0, 0);
}
}
}
Add support for the GridViewComboBoxColumn to initialize properly when the BindingList it is bound to is empty.
To reproduce :
Create a self-referencing hierarchy, bind it to a BindingList and delete the row with either the delete button or from the context menu and click the deleted item.
Workaround :
Find the object that has to be deleted, hide the selected row and remove the found object from the data source.
void radGridView1_UserDeletingRow(object sender, GridViewRowCancelEventArgs e)
{
e.Cancel = true;
int id = int.Parse(e.Rows[0].Cells["Id"].Value.ToString());
var human = this.humans.FirstOrDefault(x => x.Id == id);
if (human != null)
{
this.radGridView1.SelectedRows[0].IsVisible = false;
this.humans.Remove(human);
}
}
To reproduce: Dim dockmem As New MemoryStream
Dim gridmem As New MemoryStream
Public Sub SetData()
' dgvSelectList.DataSource = Nothing
Dim dt As DataTable
dt = New DataTable
dt.Columns.Add("VENDCODE")
dt.Columns.Add("VENDNAME")
dt.Rows.Add("AA2", "Arthur")
dt.Rows.Add("AA2", "Arthur")
dgvSelectList.DataSource = dt
dgvSelectList.BestFitColumns()
End Sub
Private Sub frmSelectListNG2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SetData()
dgvSelectList.EnableFiltering = False
'Save Grid and Dock layout settings to mem stream and simulate my process
SaveSettings()
End Sub
Public Sub btnGO_Click(sender As System.Object, e As System.EventArgs) Handles btnGO.Click
LoadSettings()
dgvSelectList.SplitMode = RadGridViewSplitMode.Horizontal
SetData()
LoadSettings()
End Sub
Private Sub LoadSettings()
gridmem.Position = 0
dockmem.Position = 0
dgvSelectList.LoadLayout(gridmem)
rdkSelect.LoadFromXml(dockmem)
End Sub
Private Sub SaveSettings()
gridmem.Position = 0
dockmem.Position = 0
dgvSelectList.SaveLayout(gridmem)
rdkSelect.SaveToXml(dockmem)
End Sub
Workaround - set the datasource to Nothing prior rebinding
To reproduce:
radGridView1 = new RadGridView();
radGridView1.Dock = DockStyle.Fill;
Controls.Add(radGridView1);
t.Columns.Add("ID");
t.Rows.Add(7);
t.Rows.Add(5);
t.Rows.Add(8);
t.Rows.Add(4);
t.Rows.Add(9);
radGridView1.DataSource = t;
radGridView1.Columns[0].Width = 100;
With the code above, start the app, sort the grid ascending and select the row with value 8. Use the following code on a button to delete the row with value 5:
private void radButton1_Click(object sender, EventArgs e)
{
t.Rows[1].Delete();
}
In this case, the current should be the row with value 8, not the one with value 7 as is.
To reproduce:
- Create a grid with ColumnGroupsViewDefinition view( Column Groups View)
- Set the AutoSizeColumnsMode to fill
- Start the project and resize a column
- Resize a column then minimize and maximize
- The column have a different size
Workaround:
-Handle the form layout event like this:
void Form1_Layout(object sender, LayoutEventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.radGridView1.GridElement.SuspendLayout();
}
else
{
this.radGridView1.GridElement.ResumeLayout(true);
}
}
To reproduce:
public Form1()
{
InitializeComponent();
Random r = new Random();
DataTable table = new DataTable("table1");
table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Bool", typeof(bool));
table.Columns.Add("DateColumn", typeof(DateTime));
for (int i = 0; i < 10; i++)
{
table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i));
}
DataSet dataSet = new DataSet();
dataSet.Tables.Add(table);
radGridView1.DataBindingComplete += radGridView1_DataBindingComplete;
this.radGridView1.DataSource = dataSet;
this.radGridView1.DataMember = "table1";
}
void radGridView1_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
{
}
To reproduce:
-set AutoSizeMode to Fill
- Add view definition with two rows
- Add check box column to the view
-Set check box column minWidth
Workaround:
Create a custom view definition, then create a custom ColumnGroupRowLayout class and override the GetClumnWidth method like this:
class MyViewDefinition : ColumnGroupsViewDefinition
{
public MyViewDefinition()
{
}
public override IGridRowLayout CreateRowLayout()
{
return new MyRowLayout(this);
}
}
public class MyRowLayout : ColumnGroupRowLayout
{
public MyRowLayout(ColumnGroupsViewDefinition view):base(view)
{
}
public override int GetColumnWidth(GridViewColumn column)
{
return Math.Max( base.GetColumnWidth(column), column.MinWidth);
}
}
To reproduce Switch to Right-to-Left mode. Look at the top left corner of the grid. Workaround this.radGridView1.TableElement.Children[0].Margin = new Padding(-2, 0, 0, 0);
IMPROVE. RadGridView - when sorting grouped combo box column the DisplayMemberSort is not taken into consideration
Steps to reproduce: 1. Add a grid with several columns, so there is horizontal scroll bar 2. Add an image to the grid ImageList 3. In the CellFormatting assign the ImageKey of a cell to a value You will notice that the images are not applied initially. You have to scroll the column where you apply the images out of view and bring it back in to see the images. WORKAROUND Instead of setting the ImageKey property, set the Image property to the corresponding image from the image list.
Workaround: Use a custom editor and override IsModified method:
class MyEditor : RadDropDownListEditor
{
public override bool IsModified
{
get
{
return true;
}
}
}
void radGridViewFilter_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(RadDropDownListEditor)) { e.Editor = new MyEditor();
}
}
RadGridView.- HierarchyDataProvider property of the GridViewTemplate should be set after the GridViewTemplate is added to Templates Collection.
When a mask is set to a GridViewMaskBoxColumn and string is applied as value, the visual element will show only the string without the mask literals. E.g. mask is set to ####/# and value is set to string "11112" the view will be 11112 instead of 1111/2. Ways to achieve this: 1. Use CellFormatting. 2. Use a custom type converter: Example of a custom TypeConverter could be seen from the following feedback item: http://feedback.telerik.com/Project/154/Feedback/Details/112463-fix-radgridview-the-textmaskformat-property-of-gridviewmaskboxcolumn-is-not-ta