0

Inside GridView, then inside columns I have a bound field

<asp:BoundField DataField="Company Name" HeaderText="Company Name" SortExpression="Name" />

This displays a list of columns of the companys name (which is fine) however the headerText, is a clickable link that throws an error...how can i get the headertext just to display as a normal plan unclickable label

ta

John
  • 3,965
  • 21
  • 77
  • 163
  • What error are you getting? Maybe you're triggering column sorting by clicking on the header. Do you want users to be able to sort on that column? – Tim Feb 20 '13 at 16:04

3 Answers3

1

Probably because you marked the bound field to be sortable and you didn't implement the sort on the server side... probably. Remove the SortExpression and see what's happening. You should post more info starting with the exception you have.

alexb
  • 971
  • 6
  • 12
1

You can use AllowSorting="False" to the gridview.

  <asp:GridView AllowSorting="False">
      <asp:BoundField DataField="Company Name" HeaderText="Company Name"/>
  </asp:GridView>
शेखर
  • 17,412
  • 13
  • 61
  • 117
1

just remove the SortExpression

RedDevil79
  • 445
  • 5
  • 13