Results 1 to 5 of 5

Thread: DataSet in Grid Format

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    70

    DataSet in Grid Format

    Hi, i am new to ASP.NET.

    How do i display display data in a grid format, with the use of datagrid, that it repeats the rows in data set in vertical and horizontal direction. it will look like this in html:

    <table>
    <tr>
    <td>dataset Row1</td>
    <td>dataset Row2</td>
    <td>dataset Row3</td>
    </tr>
    <tr>
    <td>dataset Row4</td>
    <td>dataset Row5</td>
    <td>dataset Row6</td>
    </tr>
    </table>

    thanks!!!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: DataSet in Grid Format

    Just bind the datagrid to the dataset.

    VB Code:
    1. dg1.DataSource = dsDataSet
    2.     dg1.DataBind()

  3. #3
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: DataSet in Grid Format

    Quote Originally Posted by mendhak
    Just bind the datagrid to the dataset.

    VB Code:
    1. dg1.DataSource = dsDataSet
    2.     dg1.DataBind()
    Mendhak, shouldnt it be binded to a DataTable(e.g dsDataSet.Tables[0]) instead of DataSet? Or will it show all the DataTable using a link, something like WinForm datagrid? I never tried it, so not sure.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: DataSet in Grid Format

    No, the + thing happens in VB.NET only.

    I think what I posted is right, but since you've posted, you've confused me. However, I'm just too lazy to open up vs.net and check, so I won't.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    70

    Re: DataSet in Grid Format

    Hi,

    thanks for the reply.. but i think i'm clear abt describing my problem.. what i want to acheive is to display the rows in both direction.. what we usually get for the datagrid is that rows repeat vertically OR horizontally. so each of my rows in the datagrid will be displayed in one <td>.. so it will display as:

    <table>
    <tr>
    <td>Row 1 ID<br>
    Row 1 Description
    </td>
    <td>Row 2 ID<br>
    Row 2 Description
    </td>
    <td>Row 3 ID<br>
    Row 3 Description
    </td>
    </tr>
    <tr>
    <td>Row 4 ID<br>
    Row 4 Description
    </td>
    <td>Row 5 ID<br>
    Row 5 Description
    </td>
    <td>Row 6 ID<br>
    Row 6 Description
    </td>
    </tr>
    </table>


    is that acheivable?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width