I would like to add a button that the user can click to execute query - fills gridView control

Discussion in 'ASP .Net' started by jonny, Jul 30, 2007.

  1. jonny

    jonny Guest

    How can I do this with ASP controls & VB.NET

    On click of button run query to fill gridView.
    jonny, Jul 30, 2007
    #1
    1. Advertising

  2. jonny

    Brandon Gano Guest

    I think you want something like this (forgive the sloppy VB; I'm a C# guy):

    --aspx--
    <asp:Button ID="MyButton" runat="server" Text="Fill"
    OnClick="MyButton_Click" />
    <asp:GridView ID="MyGrid" runat="server" ...>
    ...
    </asp:GridView>

    --aspx.vb--
    Protected Sub MyButton_Click(ByVal sender As Object, ByVal e As EventArgs)

    'TODO: Create data source (MyDataSource)

    MyGrid.DataSource = MyDataSource
    MyGrid.DataBind()

    End Sub


    "jonny" <> wrote in message
    news:...
    > How can I do this with ASP controls & VB.NET
    >
    > On click of button run query to fill gridView.
    >
    Brandon Gano, Jul 30, 2007
    #2
    1. Advertising

  3. jonny

    Masudur Guest

    On Jul 30, 10:54 am, "Brandon Gano" <> wrote:
    > I think you want something like this (forgive the sloppy VB; I'm a C# guy):
    >
    > --aspx--
    > <asp:Button ID="MyButton" runat="server" Text="Fill"
    > OnClick="MyButton_Click" />
    > <asp:GridView ID="MyGrid" runat="server" ...>
    > ...
    > </asp:GridView>
    >
    > --aspx.vb--
    > Protected Sub MyButton_Click(ByVal sender As Object, ByVal e As EventArgs)
    >
    > 'TODO: Create data source (MyDataSource)
    >
    > MyGrid.DataSource = MyDataSource
    > MyGrid.DataBind()
    >
    > End Sub
    >
    > "jonny" <> wrote in message
    >
    > news:...
    >
    > > How can I do this with ASP controls & VB.NET

    >
    > > On click of button run query to fill gridView.


    Hi...

    don't forget to visit the asp.net data tutorials...
    every thing you need to work with data is there...
    http://www.asp.net/learn/data-access/

    Masudur
    Masudur, Jul 30, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    820
    Purvi T
    Oct 19, 2004
  2. Sergio E.
    Replies:
    4
    Views:
    339
    Sergio E.
    Aug 10, 2007
  3. Sergio E.
    Replies:
    4
    Views:
    770
    Sergio E.
    Aug 10, 2007
  4. Frank Kurka
    Replies:
    8
    Views:
    288
  5. Sergio E.

    get data that fills gridview inside the gridview

    Sergio E., Aug 8, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    211
    Sergio E.
    Aug 8, 2007
Loading...

Share This Page