Completed
Last Updated: 30 Jul 2013 03:20 by ADMIN
ADMIN
Georgi I. Georgiev
Created on: 30 Jul 2013 03:20
Category: GridView
Type: Bug Report
0
FIX. RadGridView - pasting in hierarchical grid pastes in the wrong 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 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
0 comments