Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a spgridview with dynamic column.

I get a data of a special list and bind to SpGridView.

I have a URL SPFieldType, i want show description in spgridview and set url for navigationurl. I use this code but both displays (url and description ).

 else if (field.Type == SPFieldType.URL)
                                {
                                    HyperLinkField link = new HyperLinkField();
                                    link.HeaderText = field.Title;
                                    link.DataNavigateUrlFields = new string[] { new SPFieldUrlValue(field.InternalName).Url };
                                    link.DataTextField = new SPFieldUrlValue(field.InternalName).Description;
                                    link.SortExpression = field.InternalName;
                                   grid.Columns.Add(link);
                                }
share|improve this question
    
What type of object is being bound to the SPGridView? A DataTable? –  Kit Menke May 24 '12 at 13:22
    
Yes, it is a Datatable of List item –  ar.gorgin May 26 '12 at 7:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.