Pregunta

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

¿Fue útil?

Solución

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

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

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top