This is a migrated thread and some comments may be shown as answers.

Error in new version Resize column programmatically

5 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 01 Oct 2015, 11:15 AM

Hi;

I found a problem in the resizing of columns when using customized groups. This error did not occur with the previous version (Q2) and has appeared in the current version (Q3).

I attached two files with the same project using the two versions. In the previous version columns are resized correctly and present it does not​. As soon as you remove your answer and projects which included two versions of DLLs that ye be easier to prove:

https://dl.dropboxusercontent.com/u/21787064/GridView_Q2.rar

https://dl.dropboxusercontent.com/u/21787064/GridView_Q3.rar​​

Is it possible I'm doing something wrong?

I regard as a very serious mistake and I can not update my applications to version Q3 until it is solved.

Regards​​

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Oct 2015, 12:47 PM
Hello Cesar,

Thank you for writing.

I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.


I have also updated your Telerik points.

Currently, the possible solution that I can suggest is either set the columns width before setting the RadGridView.ViewDefinition or call the TableElement.ViewElement.RowLayout.InvalidateRenderColumns method after specifying the width:

for (int i = 0; i < 5; i++)
{
    this.radGridView1.Columns.Add("Col" + i);
}
 
ColumnGroupsViewDefinition columnGroupsView = new ColumnGroupsViewDefinition();
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
 
columnGroupsView.ColumnGroups[0].PinPosition = PinnedColumnPosition.Left;
columnGroupsView.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[0].Rows[0].ColumnNames.Add("Col3");
this.radGridView1.Columns["Col3"].PinPosition = PinnedColumnPosition.Left;
 
columnGroupsView.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[1].Rows[0].ColumnNames.Add("Col2");
columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[2].Rows[0].ColumnNames.Add("Col0");
columnGroupsView.ColumnGroups[2].Rows[1].ColumnNames.Add("Col1");
 
columnGroupsView.ColumnGroups[3].Rows.Add(new GridViewColumnGroupRow()); 
columnGroupsView.ColumnGroups[3].PinPosition = PinnedColumnPosition.Right;
columnGroupsView.ColumnGroups[3].Rows[0].ColumnNames.Add("Col4");
this.radGridView1.Columns["Col4"].PinPosition = PinnedColumnPosition.Right;
 
this.radGridView1.ViewDefinition = columnGroupsView;
 
this.radGridView1.Columns["Col2"].Width = 150;
this.radGridView1.Columns["Col0"].Width = 200;
this.radGridView1.TableElement.ViewElement.RowLayout.InvalidateRenderColumns();

 

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Cesar
Top achievements
Rank 1
answered on 05 Oct 2015, 09:00 AM

Thank you for your answer, that option I can be used to solve the problem.

Now I find another mistake, if we group the head of the columns of the pinned cells, the ShowHeader utilizarñíamos property. If we use your code:

InitializeComponent();
 
            ColumnGroupsViewDefinition columnGroupsView;
 
            // column groups view         
            columnGroupsView = new ColumnGroupsViewDefinition();
            columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
            columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
            columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
            columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
 
            columnGroupsView.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
            columnGroupsView.ColumnGroups[0].ShowHeader = false;
            columnGroupsView.ColumnGroups[0].PinPosition = PinnedColumnPosition.Left;
            columnGroupsView.ColumnGroups[0].Rows[0].ColumnNames.Add("colPINNED_LEFT");
            this.radGridView1.Columns["colPINNED_LEFT"].PinPosition = PinnedColumnPosition.Left;
             
 
            columnGroupsView.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
            columnGroupsView.ColumnGroups[1].ShowHeader = false;
            columnGroupsView.ColumnGroups[1].Rows[0].ColumnNames.Add("colDATE");
             
            columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
            columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
            columnGroupsView.ColumnGroups[2].ShowHeader = false;
            columnGroupsView.ColumnGroups[2].Rows[0].ColumnNames.Add("colTITLE");
            columnGroupsView.ColumnGroups[2].Rows[1].ColumnNames.Add("colTEXT");
 
            columnGroupsView.ColumnGroups[3].Rows.Add(new GridViewColumnGroupRow());
            columnGroupsView.ColumnGroups[3].ShowHeader = false;
            columnGroupsView.ColumnGroups[3].PinPosition = PinnedColumnPosition.Right;
            columnGroupsView.ColumnGroups[3].Rows[0].ColumnNames.Add("colPINNED_RIGHT");
            this.radGridView1.Columns["colPINNED_RIGHT"].PinPosition = PinnedColumnPosition.Right;
             
 
 
            this.radGridView1.ViewDefinition = columnGroupsView;
 
            this.radGridView1.Columns["colDATE"].Width = 110;
            this.radGridView1.Columns["colTITLE"].Width = this.radGridView1.Width - 181;
 
            this.radGridView1.TableElement.ViewElement.RowLayout.InvalidateRenderColumns();


If we use the Q2 version works perfectly but when you upgrade to version Q3 fails.

Thanks again and I hope we can resolve errors quickly, I can not upgrade to the new version if these serious errors are not corrected.

Regards​

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Oct 2015, 11:22 AM
Hello Cesar,

Thank you for writing back.

I confirm that when setting the GridViewColumnGroup.ShowHeader property to false for a pinned group leads to layout. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is instead of setting the ShowHeader property to false use the ViewCellFormatting event to hide to necessary cell borders and customize the text alignment to simulate cells merging.

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Cesar
Top achievements
Rank 1
answered on 07 Oct 2015, 01:53 PM

Thank you for your answer again.

This type of group I have many sites included in my application and takes too much having to use the event at all.

I prefer to wait until you update the controls to change the version Q3.

Regards

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Oct 2015, 02:28 PM
Hello Cesar,

Thank you for writing back.

We will do our best to introduce a fix as soon as possible. However, I can not give you an exact or whether it will be available in the upcoming Q3 2015 SP. Make sure that you cast your vote for it and have subscribed for status changes.

If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Cesar
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Cesar
Top achievements
Rank 1
Share this question
or