C# radgridview Pinned Column

2 Answers 113 Views
GridView
Marco
Top achievements
Rank 1
Iron
Marco asked on 10 Oct 2022, 08:50 AM

Hello,

 

I'm trying to use one pinned column but when moving the bar the text from the others columns became mixed with the pinned column.

 

How to fix it?

 

Best Regards,

Marco Gaspar

 

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Oct 2022, 10:18 AM

Hello, Marco,

According to the provided information, it wouldn't be easy to conclude what causes this undesired behavior. Usually, this may be affected by the UseCompatibleTextRendering property. It controls whether GDI or GDI+ will be used for rendering the text. Is this the case on your end?

It would be greatly appreciated if you can provide a complete code snippet that leads to this behavior. Thus, we would be able to the behavior on our end and provide further assistance.

Thank you in advance for your cooperation. I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marco
Top achievements
Rank 1
Iron
commented on 10 Oct 2022, 11:03 AM | edited

Hello,

 

Telerik.WinControls.UI.GridViewTextBoxColumn radGridListaColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();

 

            radGridListaColumn1.DataType = typeof(string);
            radGridListaColumn1.FieldName = "Nº Peça";
            radGridListaColumn1.HeaderText = "Nº Peça";
            radGridListaColumn1.IsVisible = true;
            radGridListaColumn1.Name = "Nº Peça";
            radGridListaColumn1.Width = 110;
            radGridListaColumn1.FormatInfo = cultureInfo;
            radGridListaColumn1.IsPinned = true;
            radGridListaColumn1.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left;

 

            radGridListaColumn2.DataType = typeof(string);
            radGridListaColumn2.FieldName = "Designação";
            radGridListaColumn2.HeaderText = "Designação";
            radGridListaColumn2.IsVisible = true;
            radGridListaColumn2.Name = "Designação";
            radGridListaColumn2.Width = 210;
            radGridListaColumn2.TextAlignment = ContentAlignment.MiddleCenter;

            radGridLista.MasterTemplate.Columns.Add(radGridListaColumn1);                         radGridLista.MasterTemplate.Columns.Add(radGridListaColumn2);

 

radGridLista.MasterTemplate.AllowAddNewRow = false;
            radGridLista.MasterTemplate.AllowColumnChooser = false;
            radGridLista.MasterTemplate.AllowColumnHeaderContextMenu = false;
            radGridLista.MasterTemplate.AllowDragToGroup = false;
            radGridLista.MasterTemplate.AllowRowResize = false;
            radGridLista.MasterTemplate.AutoGenerateColumns = false;
            radGridLista.MasterTemplate.AllowColumnResize = false;
            radGridLista.MasterTemplate.AllowEditRow = true;

radGridLista.MasterTemplate.EnableSorting = true;

            radGridLista.MasterTemplate.AllowColumnResize = false;
            radGridLista.AllowCellContextMenu = false;
            radGridLista.AllowColumnHeaderContextMenu = false;

 

 

GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(this.radGridLista.MasterView);
                rowInfo.Cells["Nº Peça"].Value = "XPTO";
                rowInfo.Cells["Designação"].Value = "XPTO2;

radGridLista.Rows.Add(rowInfo);

Dess | Tech Support Engineer, Principal
Telerik team
commented on 11 Oct 2022, 12:02 PM

Marco, I prepared a sample project with the provided code snippet. Here is the observed result on my end:

I have attached my sample project. Please give it a try and see how it works on your end. Am I missing something? Could you please specify the exact steps how to reproduce the problem? 

0
Marco
Top achievements
Rank 1
Iron
answered on 11 Oct 2022, 01:26 PM

Thanks for the help.

 

Found the problem (UsecompatibletextRendering)

Tags
GridView
Asked by
Marco
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Marco
Top achievements
Rank 1
Iron
Share this question
or