Thanks for replying, but i still don't undertsand ...
If i add this line to the code-behind in the SelectedIndexChanged event, i
get the "ok", so why not the ShowEditButton ...?
response.write("ok")
<tommaso.gastaldi@uniroma1.it> schreef in bericht
news:1156090367.622542.84830@m79g2000cwm.googlegroups.com...
[quoted text, click to view] > asp events occur server side not client side. If there no postback the
> event handler is not executed.
>
> Try placing a break to verify the behavior.
>
> Tommaso
>
> Ben ha scritto:
>
>> 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
>