SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;
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


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

Browse other questions tagged or ask your own question.