DataGrid with a menu...

Discussion in 'ASP .Net Datagrid Control' started by Pai, Apr 30, 2004.

  1. Pai

    Pai Guest

    Hello there,

    I need to create a Data Grid for an ASP.Net Page which would have all
    these feature.

    When the user sets focus on one of the colums the column of the Data
    Grid it should display a list of menu options to the
    right hand side of the column which would have various options for
    the menu, but the menu should be smaller then the width of the

    Is it possible to trace which column the user has selected? I am also
    unable to set the AutoPostBask event for the DataGrid?

    Hope somebody has some pointer on this?

    Thanks,
    Srikanth pai.
     
    Pai, Apr 30, 2004
    #1
    1. Advertising

  2. Your way forward here is to use the itemcreated or itemdatabound event
    handler to embed javascript in the cells using the onmouseover events. You
    can add this using attributes. It follows the same pattern as row
    highlighting in a datagrid with a mouse over event.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Pai" <> wrote in message
    news:...
    > Hello there,
    >
    > I need to create a Data Grid for an ASP.Net Page which would have all
    > these feature.
    >
    > When the user sets focus on one of the colums the column of the Data
    > Grid it should display a list of menu options to the
    > right hand side of the column which would have various options for
    > the menu, but the menu should be smaller then the width of the
    >
    > Is it possible to trace which column the user has selected? I am also
    > unable to set the AutoPostBask event for the DataGrid?
    >
    > Hope somebody has some pointer on this?
    >
    > Thanks,
    > Srikanth pai.
     
    Alvin Bruney [MVP], May 1, 2004
    #2
    1. Advertising

  3. Pai

    Srikanth Pai Guest

    Hello Alvin,

    Thanks for you reply, is it possible for you to kindly guide me to some
    site which has embeds javascript in the cells using the mouseover.

    I am still unable to understand how the code would understand which
    column has been selected in the datagrid, when i placed the datagrid on
    the .aspx page i couldnot understand or find any method which would help
    me be able to distinguish the columns or rows in the datagrid.

    Also I would like to have a "+" sign which would group a set of rows in
    the datagrid and "-" which would collapse all the rows and show is it
    possible to implement this functionality using data grid or would i have
    to use any other control?

    I would appreciate if you would guide me in this

    Thanks,
    Srikanth Pai.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Srikanth Pai, May 1, 2004
    #3
  4. for the plus/- signs, you will need to add a column and set the text to

    for the itemdatabound you can use something like this
    if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)
    {
    e.Item.Attributes.Add("onmouseover",
    "this.style.backgroundColor='lightblue'");


    this would put the mouse over for the entire row. if you want fine grain,
    you can put the mouseover on a particular cell, which corresponds to a
    column in the datagrid. Consider a mouseover event that calls a function
    only on column 4

    e.Item[5].Attributes.Add("onmouseover", "callMyJavascriptFunction()'");

    when the user mouses over cell 4, the event fires and calls
    callmyjavascriptfunction. You would be responsible for defining that
    function clientside

    for the +/- signs, you can add a column to the datagrid and set the text to
    a "+" or "-". For both plus and minus, you will need to change the character
    set to something like latin-1 - there is a plus/minus symbol in there you
    can use as text. The button click would fire the itemcommand event so you
    would handle this event to figure out what to do with the code.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Srikanth Pai" <> wrote in message
    news:%...
    > Hello Alvin,
    >
    > Thanks for you reply, is it possible for you to kindly guide me to some
    > site which has embeds javascript in the cells using the mouseover.
    >
    > I am still unable to understand how the code would understand which
    > column has been selected in the datagrid, when i placed the datagrid on
    > the .aspx page i couldnot understand or find any method which would help
    > me be able to distinguish the columns or rows in the datagrid.
    >
    > Also I would like to have a "+" sign which would group a set of rows in
    > the datagrid and "-" which would collapse all the rows and show is it
    > possible to implement this functionality using data grid or would i have
    > to use any other control?
    >
    > I would appreciate if you would guide me in this
    >
    > Thanks,
    > Srikanth Pai.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Alvin Bruney [MVP], May 2, 2004
    #4
    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. Miguel Dias Moura
    Replies:
    3
    Views:
    4,320
    Bruno Sirianni
    Apr 3, 2004
  2. Vilmar
    Replies:
    0
    Views:
    474
    Vilmar
    May 27, 2004
  3. itzikkl
    Replies:
    0
    Views:
    5,780
    itzikkl
    Mar 27, 2005
  4. mike
    Replies:
    2
    Views:
    600
  5. Bryan
    Replies:
    1
    Views:
    782
    Steven Cheng[MSFT]
    Mar 1, 2006
Loading...

Share This Page