Columnspan in Datagrid ?

Discussion in 'ASP .Net' started by ajaymehra, Feb 6, 2004.

  1. ajaymehra

    ajaymehra Guest

    Hi,
    I am using a dataview as my datagrids datasource and binding i
    dynamically.
    Can I specify a column span for a single row of a datagrid?

    Thanks in advance,
    Aja

    ajaymehr
    -----------------------------------------------------------------------
    Posted via http://www.mcse.m
    -----------------------------------------------------------------------
    View this thread: http://www.mcse.ms/message367697.htm
    ajaymehra, Feb 6, 2004
    #1
    1. Advertising

  2. sure,
    do so in the itemdatabound. each row gets bound in this event so you can
    pick your row, apply column span and then mark that row as dirty so
    columnspan doesn't get applied to every row. Use viewstate for this
    ViewState["DIRTY"] = "True"

    if(e.item.itemtype = = listitem.item)
    {
    if(ViewState["DIRTY"] == null)
    e.item.cells[2].ColumnSpan = 2;
    }

    roughly
    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "ajaymehra" <> wrote in message
    news:...
    >
    > Hi,
    > I am using a dataview as my datagrids datasource and binding it
    > dynamically.
    > Can I specify a column span for a single row of a datagrid?
    >
    > Thanks in advance,
    > Ajay
    >
    >
    > ajaymehra
    > ------------------------------------------------------------------------
    > Posted via http://www.mcse.ms
    > ------------------------------------------------------------------------
    > View this thread: http://www.mcse.ms/message367697.html
    >
    Alvin Bruney [MVP], Feb 6, 2004
    #2
    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. geronimi
    Replies:
    0
    Views:
    457
    geronimi
    Jan 2, 2006
  2. =?Utf-8?B?U2Vhblc=?=
    Replies:
    0
    Views:
    640
    =?Utf-8?B?U2Vhblc=?=
    Apr 10, 2007
  3. Stephen Miller

    ColumnSpan and FooterStyle attributes

    Stephen Miller, Feb 6, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    148
    Stephen Miller
    Feb 6, 2004
  4. mary

    Datagrid and ColumnSpan

    mary, Sep 16, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    111
  5. J055
    Replies:
    4
    Views:
    728
    Steven Cheng[MSFT]
    Jun 14, 2006
Loading...

Share This Page