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

Duplicate Columns

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Satish Kumar
Top achievements
Rank 1
Satish Kumar asked on 20 Mar 2015, 01:45 AM
Hi,

I have a RadGrid which is initialzed to a SqlDataSource and itz working fine. Now, I want to make one of the data field from the sql source as a HyperText.

I am doing following in Code Behind.

GridHyperLinkColumn hyperlinkcolumn = GridHyperLinkColumn();
hyperlinkcolumn.DataField = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFields = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFormatString = "URL String"

MyGrid.Columns.Add(hyperlinkcolumn);

Whne I do this, I am seeing two columns. One original column from the sql data source and one hyperlink column i added.

I tried additing to MasterTableView as well. But still two columns are coming.

I expect only hypertext column to present and original column to not present.

How to achieve this??

THanks
Satish

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Mar 2015, 12:58 PM
Hi Satish,

Most probably, you are using AutoGenerateColumns and the manually created column is duplicated with the automatically generated one. To prevent that, you can access the automatically created column and hide it disabling its Visible property during the ColumnCreated event handler:
http://www.telerik.com/help/aspnet-ajax/grid-customizing-autogenerated-columns.html

Hope this helps.

Regards,
Eyup
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Satish Kumar
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or