Frage

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

War es hilfreich?

Lösung

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

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

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top