GridView ... confusing behavior

Discussion in 'ASP .Net' started by shapper, Mar 9, 2007.

  1. shapper

    shapper Guest

    Hello,

    I created a GridView which DataSource is created a DataView created in
    a function.
    The DataView is created from a DataTable which is saved on a Session
    Variable.

    The DataView has 3 bound fields:
    Name, Description and Visible

    And 1 Button Field:
    Remove

    The DataView is created as follows:

    dv = New DataView(dt, "Visible = True", "Name",
    DataViewRowState.CurrentRows)

    When I click a button on a row I define the Visible Field as False on
    RowCommand event:

    dt.Rows.Item(e.CommandArgument)("Visible") = False
    dt.DataBind

    I am able to change the Visible field a first time but after that I am
    not able to do that anymore.

    When I click a button I see that the index is right in the list that I
    see in the GridView.
    However, for that index I get the data not of the row that I am
    looking but of the original row on that position before I click the
    button and make one of the rows Visible to false.

    I have not been able to figure what might be going on.

    Could someone give me a tip where to look for?

    I looked everywhere and I can't find the solution.

    Thanks,
    Miguel
     
    shapper, Mar 9, 2007
    #1
    1. Advertising

  2. shapper

    Greg9Strat Guest

    On 8 mar, 18:36, "shapper" <> wrote:
    > Hello,
    >
    > I created a GridView which DataSource is created a DataView created in
    > a function.
    > The DataView is created from a DataTable which is saved on a Session
    > Variable.
    >
    > The DataView has 3 bound fields:
    > Name, Description and Visible
    >
    > And 1 Button Field:
    > Remove
    >
    > The DataView is created as follows:
    >
    > dv = New DataView(dt, "Visible = True", "Name",
    > DataViewRowState.CurrentRows)
    >
    > When I click a button on a row I define the Visible Field as False on
    > RowCommand event:
    >
    > dt.Rows.Item(e.CommandArgument)("Visible") = False
    > dt.DataBind
    >
    > I am able to change the Visible field a first time but after that I am
    > not able to do that anymore.
    >
    > When I click a button I see that the index is right in the list that I
    > see in the GridView.
    > However, for that index I get the data not of the row that I am
    > looking but of the original row on that position before I click the
    > button and make one of the rows Visible to false.
    >
    > I have not been able to figure what might be going on.
    >
    > Could someone give me a tip where to look for?
    >
    > I looked everywhere and I can't find the solution.
    >
    > Thanks,
    > Miguel



    If you can post your code it would be more helpful...
     
    Greg9Strat, Mar 9, 2007
    #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. clintonG
    Replies:
    4
    Views:
    611
    clintonG
    Oct 17, 2005
  2. scigeek
    Replies:
    7
    Views:
    374
    scigeek
    Sep 8, 2009
  3. paul

    confusing thread behavior

    paul, Dec 3, 2009, in forum: Python
    Replies:
    2
    Views:
    448
  4. Rudi Cilibrasi
    Replies:
    6
    Views:
    877
    Rudi Cilibrasi
    Nov 6, 2011
  5. szymon.rozga

    Confusing code behavior in Rails

    szymon.rozga, Jun 21, 2005, in forum: Ruby
    Replies:
    4
    Views:
    130
    Chris McGrath
    Jun 21, 2005
Loading...

Share This Page