Thursday, 5 September 2013

VB.NET Grid view with variable button text

VB.NET Grid view with variable button text

How can I make the text of a button in a Gridview change depending on the
values in the gridview
For example, in the code below, how can I set the button text to YOUNG for
rows where the age is below 40 and OLD for rows above or equal to 40
<asp:GridView ID="GV_DataByGroupAct" runat="server"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Age" HeaderText="Age" />
<asp:BoundField DataField="Hight" HeaderText="Hight" />
<asp:ButtonField Text="Young/Old" />
</Columns>
</asp:GridView>
Thanks

No comments:

Post a Comment