how to make commandbutton invisible?

B

Ben

Hi,

I have a gridview with ShowSelectButton="True" and ShowEditButton="False".
When clicking on the 'Select' button (SelectedIndexChanged event), i want to
make it invisible and make the ShowEditButton visible.
I tried this but it doesn't work (Select is still visible and Edit is still
invisible).

aspx code:
----------
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowSelectButton="True" ShowEditButton="False" />
.......

code-behind:
-------------
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As
System.EventArgs) Handles GridView1.SelectedIndexChanged
dim cf As CommandField
cf = New CommandField
cf.ShowSelectButton = False
cf.ShowEditButton = True
End Sub


Thanks for help
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top