Good morning Michael,
Everytime you change grid's view apperance, you have to rebind the data to
see the effect:
cf = GridView1.Columns.Item(0)
cf.ShowEditButton = True
GridView1.DataSource = dataSource
GridView1.DataBind()
--
Milosz
"michel" wrote:
> Hi,
>
> there is a gridview with a Commandfield.
> I would like to set the 'ShowEditButton' on 'true' programmatically.
> I tried two ways without succes:
>
> with "'Dim cf As CommandField
> with "'Dim cf As new CommandField"
>
> no error but no ShowEditButton:
>
> aspx file:
> -------
> <asp:GridView ID="GridView1" runat="server">
> <Columns>
> <asp:CommandField />
> .........
> </Columns>
> </asp:GridView>
>
>
> code-behind:
> -------------
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
> Handles Me.Load
> 'Dim cf As CommandField
> Dim cf As new CommandField
> cf = GridView1.Columns.Item(0)
> cf.ShowEditButton = True
>
> ....
>
>
>
>
|