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

Automatic Column UniqueName rename

4 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Franz
Top achievements
Rank 1
Franz asked on 13 May 2015, 10:22 AM

Hi,

Recently I upgraded to Version 2015.1.401.45.  After this upgrade, a column with name 'IsNew'  that should be hidden. was displayed, although in the version before it is not displayed.

When debugging, I found out, that this column is renamed automatically to IsNew1. There is no other column with the same name in my datasource.

So I suppose, that with the new version IsNew is recognized to be a keyword??

 This is the method for hiding columns:

private void HideColumns()
        {
 
            //set the visibility of columns defined in HiddenColumns to false
            if (CGGrid.MasterTableView.Items.Count >= 0)
            {
 
                foreach (var item in HiddenColumns.Where(item => !String.IsNullOrEmpty(item)))
                {
                    try
                    {
                        var column = CGGrid.MasterTableView.GetColumn(item);
                        if (column != null) column.Visible = false;

                    }
                    catch (Exception e)
                    {
                        LOGGER.Error(e);
                    }
                }
            }
        }

4 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 18 May 2015, 06:05 AM
Hello Franz,

I used the provided code and I prepared a small runnable sample based on it. Nevertheless on my side the column is hiding properly and the UniqueName remains unchanged. Could you please check out the attached sample and let me now how it differs from your real setup?

Regards,
Kostadin
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
Jason M
Top achievements
Rank 1
answered on 16 Jul 2015, 10:26 PM

Hello Franz,

I am running into an issue where one of my auto-generated column's UniqueName is getting a 1 appended onto it, the column is not hidden. Did you find a solution to this issue?

Thank You,

Jason

0
Kostadin
Telerik team
answered on 21 Jul 2015, 10:53 AM
Hello Jason,

Could you please send your code declaration and the related code behind in order to investigate the cause for this issue further. Generally when using auto-generated columns the UniqueNames will be the same as the names of you database fields.

Regards,
Kostadin
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
Jason M
Top achievements
Rank 1
answered on 31 Aug 2015, 05:09 PM

Hello Kostadin,

Thank you for your response. I did not see the email notifying me of it, so I apologize for the delay. I resolved the issue by defining the data structure of my grid columns in the Page_Init instead of the Page_Load. I found this in ​another of the telerik forum threads. 

 Thank You,

Jason M

Tags
Grid
Asked by
Franz
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Jason M
Top achievements
Rank 1
Share this question
or