Select datagrid item programatically in ASP.NET

Discussion in 'ASP .Net Web Controls' started by Joseph T.S.Lim, Jul 1, 2003.

  1. Hi all,

    I have a question on ASP.NET Datagrid.
    Here goes nothing :-

    I have a datagrid with a SELECTCOMMAND on the first column.
    Whenever i click on the first column, it will highlight the particular
    item.
    No problem with this. I want to know how do i select a datagrid
    item when i click on a button without clicking on the datagrid item.

    For example, when i click button A, the datagrid will select my desire
    row item
    highlight it. I want to achieve this on the Code behind, i don't want
    to
    use the __doPostBack("gridID:_ctl?_ctl?", ""). I able to select it via
    the client script but i don't want.
    Joseph T.S.Lim, Jul 1, 2003
    #1
    1. Advertising

  2. Joseph T.S.Lim

    Teemu Keiski Guest

    Answered the same one on buildingcontrols:

    "One way is just to set the DataGrid's SelectedIndex property as you wish.

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com

    Email:


    "
    "Joseph T.S.Lim" <> wrote in message
    news:...
    > Hi all,
    >
    > I have a question on ASP.NET Datagrid.
    > Here goes nothing :-
    >
    > I have a datagrid with a SELECTCOMMAND on the first column.
    > Whenever i click on the first column, it will highlight the particular
    > item.
    > No problem with this. I want to know how do i select a datagrid
    > item when i click on a button without clicking on the datagrid item.
    >
    > For example, when i click button A, the datagrid will select my desire
    > row item
    > highlight it. I want to achieve this on the Code behind, i don't want
    > to
    > use the __doPostBack("gridID:_ctl?_ctl?", ""). I able to select it

    via
    > the client script but i don't want.
    >
    >
    Teemu Keiski, Jul 1, 2003
    #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. John
    Replies:
    1
    Views:
    1,187
    Eliyahu Goldin
    Sep 9, 2004
  2. Joseph T.S.Lim

    Select datagrid item programmatically in ASP.NET

    Joseph T.S.Lim, Jul 1, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    351
    Teemu Keiski
    Jul 1, 2003
  3. JamesB

    select listbox item programatically not working?

    JamesB, Dec 12, 2007, in forum: ASP .Net Web Controls
    Replies:
    8
    Views:
    265
    Jeremy
    Dec 15, 2007
  4. K. Lobe

    How do I select item in <SELECT>

    K. Lobe, Jul 2, 2003, in forum: ASP General
    Replies:
    3
    Views:
    122
    K. Lobe
    Jul 2, 2003
  5. Replies:
    2
    Views:
    184
Loading...

Share This Page