Select datagrid item programmatically in ASP.NET

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Select datagrid item programmatically in ASP.NET

    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 Guest

  2. Similar Questions and Discussions

    1. How to select some settings programmatically at startup?
      I developed a plugin which performs some stuff upon a PDF being opened. I would like to add at least one action: "clicking" the option called "Click...
    2. xml - how to select next item in loop?
      Hello, Sorry to crosspost, just didn't know which group was more relevant. I am importing an xml file into my flash and assigning the value...
    3. Change style of a single row of the item list of datagrid, based on a field value of current item...
      Sorry for the long subject guys, but I don't know how better I can resume the matter... Anyway, I have my datagrid showing items of an order. I...
    4. Programmatically Adding An Item To The DataList
      Hi all, I've a DataList control and it's DataBound by a SqlDataReader... The Reader returns say 3 records and as expected the datalist shows 3...
    5. Programmatically Selecting Item in Radio Button List
      I have created a radio button list programmatically. C# SqlConnection conn = new SqlConnection("data source=localhost; integrated security=true;...
  3. #2

    Default Re: Select datagrid item programmatically in ASP.NET

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

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

    ASP.NET Forums Moderator, [url]www.asp.net[/url]
    AspAlliance Columnist, [url]www.aspalliance.com[/url]

    Email:
    [email]joteke@aspalliance.com[/email]

    "Joseph T.S.Lim" <joseph_net@hotmail.com> wrote in message
    news:uRk%23Cg3PDHA.2676@TK2MSFTNGP10.phx.gbl...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139