datagrid manipulation

Discussion in 'ASP .Net Datagrid Control' started by Dhruv, Jul 8, 2004.

  1. Dhruv

    Dhruv Guest

    Hi,

    I have a question about custom datagrids or how i should show my
    results

    I have a sql statement that reads as follows:

    SELECT News_Title, News_Description FROM SiteNews WHERE (News_ID =
    & Me.News_State.news_id & ")"

    the output I get is

    column1 | column2
    -------------------
    1 | hello
    -------------------
    2 | hello2


    Is there a way to have it do this with paging in datagrid or another
    ..net object?

    1
    ----------
    hello
    (linkForPage2Here - for second record- 1 record per page)

    So again not side by side output like database table but the way i
    specified above with row format.

    Thanks

    :D
    Dhruv, Jul 8, 2004
    #1
    1. Advertising

  2. One approach is to go ahead and bind as usual then loop thru remove all the
    other rows from the grid - or in the dataset depending on your approach.
    Then, you would need to add a row and customize it to take a hyperlink
    control
    e.item.cells[0].controls.add(new hyperlinkbutton("link goes here"))

    next you would map the click event to a routine which basically does the
    same thing again but for row 2 in the dataset, since you already did row 1.
    You can keep a static running count to help you with that.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Dhruv" <> wrote in message
    news:...
    > Hi,
    >
    > I have a question about custom datagrids or how i should show my
    > results
    >
    > I have a sql statement that reads as follows:
    >
    > SELECT News_Title, News_Description FROM SiteNews WHERE (News_ID =
    > & Me.News_State.news_id & ")"
    >
    > the output I get is
    >
    > column1 | column2
    > -------------------
    > 1 | hello
    > -------------------
    > 2 | hello2
    >
    >
    > Is there a way to have it do this with paging in datagrid or another
    > .net object?
    >
    > 1
    > ----------
    > hello
    > (linkForPage2Here - for second record- 1 record per page)
    >
    > So again not side by side output like database table but the way i
    > specified above with row format.
    >
    > Thanks
    >
    > :D
    Alvin Bruney [MVP], Jul 8, 2004
    #2
    1. Advertising

  3. Dhruv

    Dhruv Guest

    Sorry,

    However I'm new to asp.net so can you give me an example. I understand
    what you are saying however I dont know how someone should code it.

    I'm still not sure how your answer would take care of the problem that
    the grid displays data like this:

    column1 | column 2 | column 3|
    ------------------------------
    text1 text 2 text 3

    change to

    (column1) text1
    ----------------
    (column2) text 2
    -----------------
    (column3) text 3

    Can you provide me with a real working example.

    Thank you so much.

    :D


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Dhruv, Jul 8, 2004
    #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. js
    Replies:
    1
    Views:
    2,564
    =?Utf-8?B?RWx0b24gVw==?=
    Jul 20, 2005
  2. pbd22
    Replies:
    0
    Views:
    292
    pbd22
    Mar 10, 2008
  3. Andreas Klemt
    Replies:
    0
    Views:
    293
    Andreas Klemt
    Oct 8, 2003
  4. Richard

    DataGrid : dynamic manipulation of a template column using C#

    Richard, Jan 30, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    7
    Views:
    232
    Richard
    Feb 5, 2004
  5. ralf

    datagrid manipulation issue

    ralf, Nov 9, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    120
Loading...

Share This Page