How to dynamically create a datagrid ?

Posted on 2005-05-10
Last Modified: 2010-04-23

I have a drop down list and a select button.
when a ddl item is selected and the select button is pressed, i would like to create (i mean populate ) a datagrid dynamically..

How exactly i do that .......

so far, i just created the datagrid as usual without considering the ddl and the select button...

Question by:_Esam
    LVL 4

    Accepted Solution

    from what i understand of the question heres an easy approach

    create a datagrid...make it invisible..
    when u make a selection on the drop down list and click the button, set the datasource accordingly and make it visible..

    for example..

    private sub button_Click(.....)
      dataset = getData(selected_item)
      datagrid.DataSource = dataset.table(0)
      datagrid.Visible = True
    end sub


    Author Comment

    Indeed, it's fairly easy...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now