Groups | Blog | Home
all groups > vb.net controls > august 2006 >

vb.net controls : why does the ShowEditButton not become visible with this code?


tommaso.gastaldi NO[at]SPAM uniroma1.it
8/20/2006 9:12:47 AM
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:

[quoted text, click to view]
Ben
8/20/2006 2:54:59 PM
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


Ben
8/20/2006 7:57:18 PM
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]

AddThis Social Bookmark Button