datagrid selected item

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, May 13, 2005.

  1. hey all,

    when you first load a page with a datagrid item on it, is the first record
    always selected by default? if so, is there a way to have it where nothing is
    selected by default?

    thanks,
    rodchar
    =?Utf-8?B?cm9kY2hhcg==?=, May 13, 2005
    #1
    1. Advertising

  2. Hi Rodchar,

    Actually, nothing can be automatically selected in web datagrid. If you want
    to select any item, you have to use EditCommandColumn/CommandColumn or other
    means, such as checkbox in TemplateColumn.

    HTH

    Elton Wang



    "rodchar" wrote:

    > hey all,
    >
    > when you first load a page with a datagrid item on it, is the first record
    > always selected by default? if so, is there a way to have it where nothing is
    > selected by default?
    >
    > thanks,
    > rodchar
    =?Utf-8?B?RWx0b24gVw==?=, May 13, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?cm9kY2hhcg==?=

    Teemu Keiski Guest

    Hi,

    no, it shouldn't be selected by default. SelectedIndex is -1 unless you
    manually set it, or do a selection on the grid.

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU

    "rodchar" <> wrote in message
    news:...
    > hey all,
    >
    > when you first load a page with a datagrid item on it, is the first record
    > always selected by default? if so, is there a way to have it where nothing
    > is
    > selected by default?
    >
    > thanks,
    > rodchar
    Teemu Keiski, May 13, 2005
    #3
  4. Hi

    you can choose the selected record
    dataGrid1.CurrentRowIndex = 0;

    Moti

    "rodchar" wrote:

    > hey all,
    >
    > when you first load a page with a datagrid item on it, is the first record
    > always selected by default? if so, is there a way to have it where nothing is
    > selected by default?
    >
    > thanks,
    > rodchar
    =?Utf-8?B?TW90aQ==?=, May 13, 2005
    #4
  5. thanks for all the help.

    "Moti" wrote:

    > Hi
    >
    > you can choose the selected record
    > dataGrid1.CurrentRowIndex = 0;
    >
    > Moti
    >
    > "rodchar" wrote:
    >
    > > hey all,
    > >
    > > when you first load a page with a datagrid item on it, is the first record
    > > always selected by default? if so, is there a way to have it where nothing is
    > > selected by default?
    > >
    > > thanks,
    > > rodchar
    =?Utf-8?B?cm9kY2hhcg==?=, Jun 3, 2005
    #5
    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. B. Jenkins
    Replies:
    0
    Views:
    461
    B. Jenkins
    Sep 28, 2004
  2. TB
    Replies:
    5
    Views:
    1,015
  3. Iain
    Replies:
    3
    Views:
    927
  4. mldardy
    Replies:
    0
    Views:
    961
    mldardy
    Sep 28, 2010
  5. janetb

    datagrid selected item

    janetb, May 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    124
    janetb
    May 11, 2006
Loading...

Share This Page