Luca Romagnoli
Luca Romagnoli

Reputation: 12465

set visible = false to a asp:BoundField

i have a gridview width a boundfield:

<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome"  />

i want set the visible parameter of this by a condition in page_load method.

is possible?

thanks

Upvotes: 0

Views: 1025

Answers (1)

Tim Ebenezer
Tim Ebenezer

Reputation: 2724

After calling EnsureChildControls(), you will be able to iterate over the GridViewRows and use FindControl to pick out this field (assuming you set an ID and runat="server").

Upvotes: 1

Related Questions