Adding a second row to a datagriditem?

Discussion in 'ASP .Net Web Controls' started by Steve Hershoff, Aug 8, 2006.

  1. Hi everyone,

    I'm wondering if anyone has a suggestion on how to do this, or if it's even
    possible.

    In my datagrid's OnItemDataBound function I'd like to somehow "add" a child
    row beneath one of the datagriditems (chosen via a QueryString variable) and
    use it to hold a secondary datagrid. It would act as a drilldown of sorts,
    showing more information not displayed in the datagriditem itself.

    I know I can add this new datagrid to one of the datagriditem's existing
    cells, but I can't get it to span multiple columns without shoving aside the
    other columns in the datagriditem. That's where my idea of this second row
    has come from. So far I'm not having any luck however.

    If you know of some way I can pull this off (or a reasonable facsimile
    thereof) I'd be grateful. Thanks very much!

    -Steve
    Steve Hershoff, Aug 8, 2006
    #1
    1. Advertising

  2. Steve Hershoff

    Kumar Reddi Guest

    you should use datalist instead.. you will have more control on the HTML.

    I had the same issue in my recent project.. initially i tried with datagrids
    like you are doing.. but couldnt succeed.. so went with datalist's and it
    worked like a charm

    "Steve Hershoff" <> wrote in message
    news:%...
    > Hi everyone,
    >
    > I'm wondering if anyone has a suggestion on how to do this, or if it's
    > even possible.
    >
    > In my datagrid's OnItemDataBound function I'd like to somehow "add" a
    > child row beneath one of the datagriditems (chosen via a QueryString
    > variable) and use it to hold a secondary datagrid. It would act as a
    > drilldown of sorts, showing more information not displayed in the
    > datagriditem itself.
    >
    > I know I can add this new datagrid to one of the datagriditem's existing
    > cells, but I can't get it to span multiple columns without shoving aside
    > the other columns in the datagriditem. That's where my idea of this
    > second row has come from. So far I'm not having any luck however.
    >
    > If you know of some way I can pull this off (or a reasonable facsimile
    > thereof) I'd be grateful. Thanks very much!
    >
    > -Steve
    >
    Kumar Reddi, Aug 8, 2006
    #2
    1. Advertising

  3. As kumar explained use Datalist like so
    in ur ItemDataBund do
    Dim mychilddl As DataList =
    CType(e.Item.FindControl("idofdatalistinsidetheparentdatalist"), DataList)
    and then add control
    e.item.controls.Add(mychilddl)
    hope that helps
    Patrick


    "Kumar Reddi" <> wrote in message
    news:...
    > you should use datalist instead.. you will have more control on the HTML.
    >
    > I had the same issue in my recent project.. initially i tried with
    > datagrids like you are doing.. but couldnt succeed.. so went with
    > datalist's and it worked like a charm
    >
    > "Steve Hershoff" <> wrote in message
    > news:%...
    >> Hi everyone,
    >>
    >> I'm wondering if anyone has a suggestion on how to do this, or if it's
    >> even possible.
    >>
    >> In my datagrid's OnItemDataBound function I'd like to somehow "add" a
    >> child row beneath one of the datagriditems (chosen via a QueryString
    >> variable) and use it to hold a secondary datagrid. It would act as a
    >> drilldown of sorts, showing more information not displayed in the
    >> datagriditem itself.
    >>
    >> I know I can add this new datagrid to one of the datagriditem's existing
    >> cells, but I can't get it to span multiple columns without shoving aside
    >> the other columns in the datagriditem. That's where my idea of this
    >> second row has come from. So far I'm not having any luck however.
    >>
    >> If you know of some way I can pull this off (or a reasonable facsimile
    >> thereof) I'd be grateful. Thanks very much!
    >>
    >> -Steve
    >>

    >
    >
    Patrick.O.Ige, Aug 8, 2006
    #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. Steve Hershoff

    Adding a second row to a datagriditem?

    Steve Hershoff, Aug 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    543
    Gaurav Vaish \(www.EduJini.IN\)
    Aug 10, 2006
  2. Steve Hershoff

    Adding a second row to a datagriditem?

    Steve Hershoff, Aug 8, 2006, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    112
    Patrick.O.Ige
    Aug 8, 2006
  3. Samuel Chowdhuri
    Replies:
    1
    Views:
    305
    Alvin Bruney
    Oct 20, 2003
  4. D
    Replies:
    0
    Views:
    198
  5. yelipolok
    Replies:
    4
    Views:
    244
    John W. Krahn
    Jan 27, 2010
Loading...

Share This Page