Question

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

Was it helpful?

Solution

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

  <asp:GridView AllowSorting="False">
      <asp:BoundField DataField="Company Name" HeaderText="Company Name"/>
  </asp:GridView>

OTHER TIPS

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.

just remove the SortExpression

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top