grid postback

Discussion in 'ASP .Net Web Controls' started by Cam, Dec 28, 2005.

  1. Cam

    Cam Guest

    in a grid with templates update,delete, edit. why the buttons need to be
    clicked twice in order to take action.

    grid.item command fires up every time a button is clicked.
    it's just the button action that don't execute....

    anyone else had that issue?
    Cam, Dec 28, 2005
    #1
    1. Advertising

  2. The answer depends on which asp.net version are you using and how do you
    databind the grid?

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Cam" wrote:

    > in a grid with templates update,delete, edit. why the buttons need to be
    > clicked twice in order to take action.
    >
    > grid.item command fires up every time a button is clicked.
    > it's just the button action that don't execute....
    >
    > anyone else had that issue?
    Phillip Williams, Dec 28, 2005
    #2
    1. Advertising

  3. Cam

    Cam Guest

    v 1.1
    void refreshgrid(){
    grid.datasource = ds (populated dataset)
    grid.databind.
    }
    grid_itemcommand(object source,
    System.Web.UI.WebControls.DataGridCommandEventArgs e){
    switch(e.commandname){
    case "update":
    //stepped through here.. update the dbase
    refreshgrid(); //though executed... doesn't refresh.
    break;
    }
    }
    if i close the browser and open the page again... the change made is
    displayed.
    click on edit once... nothing. twice then edit box is there.
    click on save onece... nothing. twice it saves and don't display...
    never seen this b 4
    "Phillip Williams" wrote:

    > The answer depends on which asp.net version are you using and how do you
    > databind the grid?
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Cam" wrote:
    >
    > > in a grid with templates update,delete, edit. why the buttons need to be
    > > clicked twice in order to take action.
    > >
    > > grid.item command fires up every time a button is clicked.
    > > it's just the button action that don't execute....
    > >
    > > anyone else had that issue?
    Cam, Dec 28, 2005
    #3
  4. Is the grid placed on the webform dynamically or declaratively? When the
    page is loaded how do you call the refreshgrid method and during which event
    handling?
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Cam" wrote:

    > v 1.1
    > void refreshgrid(){
    > grid.datasource = ds (populated dataset)
    > grid.databind.
    > }
    > grid_itemcommand(object source,
    > System.Web.UI.WebControls.DataGridCommandEventArgs e){
    > switch(e.commandname){
    > case "update":
    > //stepped through here.. update the dbase
    > refreshgrid(); //though executed... doesn't refresh.
    > break;
    > }
    > }
    > if i close the browser and open the page again... the change made is
    > displayed.
    > click on edit once... nothing. twice then edit box is there.
    > click on save onece... nothing. twice it saves and don't display...
    > never seen this b 4
    > "Phillip Williams" wrote:
    >
    > > The answer depends on which asp.net version are you using and how do you
    > > databind the grid?
    > >
    > > --
    > > HTH,
    > > Phillip Williams
    > > http://www.societopia.net
    > > http://www.webswapp.com
    > >
    > >
    > > "Cam" wrote:
    > >
    > > > in a grid with templates update,delete, edit. why the buttons need to be
    > > > clicked twice in order to take action.
    > > >
    > > > grid.item command fires up every time a button is clicked.
    > > > it's just the button action that don't execute....
    > > >
    > > > anyone else had that issue?
    Phillip Williams, Dec 28, 2005
    #4
  5. Cam

    Cam Guest

    page_load(....){
    if(!ispostback){
    refrreshgrid();
    }
    }

    thanks
    "Phillip Williams" wrote:

    > Is the grid placed on the webform dynamically or declaratively? When the
    > page is loaded how do you call the refreshgrid method and during which event
    > handling?
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Cam" wrote:
    >
    > > v 1.1
    > > void refreshgrid(){
    > > grid.datasource = ds (populated dataset)
    > > grid.databind.
    > > }
    > > grid_itemcommand(object source,
    > > System.Web.UI.WebControls.DataGridCommandEventArgs e){
    > > switch(e.commandname){
    > > case "update":
    > > //stepped through here.. update the dbase
    > > refreshgrid(); //though executed... doesn't refresh.
    > > break;
    > > }
    > > }
    > > if i close the browser and open the page again... the change made is
    > > displayed.
    > > click on edit once... nothing. twice then edit box is there.
    > > click on save onece... nothing. twice it saves and don't display...
    > > never seen this b 4
    > > "Phillip Williams" wrote:
    > >
    > > > The answer depends on which asp.net version are you using and how do you
    > > > databind the grid?
    > > >
    > > > --
    > > > HTH,
    > > > Phillip Williams
    > > > http://www.societopia.net
    > > > http://www.webswapp.com
    > > >
    > > >
    > > > "Cam" wrote:
    > > >
    > > > > in a grid with templates update,delete, edit. why the buttons need to be
    > > > > clicked twice in order to take action.
    > > > >
    > > > > grid.item command fires up every time a button is clicked.
    > > > > it's just the button action that don't execute....
    > > > >
    > > > > anyone else had that issue?
    Cam, Dec 28, 2005
    #5
  6. Check the AutoEventWireup value in the page directive and the OnInit method
    within the "Web Form Designer generated Code" region. If the AutoEventWireUp
    were set to "true" and the OnInit has this line of code in it:

    this.Load += new System.EventHandler(this.Page_Load);

    If that is the case then your application is calling the Page_Load twice
    thereby messing up the databinding sequence that you have. If it turns out to
    be the case you can either set the AutoEventWireUp=â€false†or remove wiring
    up the event handling in the OnInit method.

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Cam" wrote:

    > page_load(....){
    > if(!ispostback){
    > refrreshgrid();
    > }
    > }
    >
    > thanks
    > "Phillip Williams" wrote:
    >
    > > Is the grid placed on the webform dynamically or declaratively? When the
    > > page is loaded how do you call the refreshgrid method and during which event
    > > handling?
    > > --
    > > HTH,
    > > Phillip Williams
    > > http://www.societopia.net
    > > http://www.webswapp.com
    > >
    > >
    > > "Cam" wrote:
    > >
    > > > v 1.1
    > > > void refreshgrid(){
    > > > grid.datasource = ds (populated dataset)
    > > > grid.databind.
    > > > }
    > > > grid_itemcommand(object source,
    > > > System.Web.UI.WebControls.DataGridCommandEventArgs e){
    > > > switch(e.commandname){
    > > > case "update":
    > > > //stepped through here.. update the dbase
    > > > refreshgrid(); //though executed... doesn't refresh.
    > > > break;
    > > > }
    > > > }
    > > > if i close the browser and open the page again... the change made is
    > > > displayed.
    > > > click on edit once... nothing. twice then edit box is there.
    > > > click on save onece... nothing. twice it saves and don't display...
    > > > never seen this b 4
    > > > "Phillip Williams" wrote:
    > > >
    > > > > The answer depends on which asp.net version are you using and how do you
    > > > > databind the grid?
    > > > >
    > > > > --
    > > > > HTH,
    > > > > Phillip Williams
    > > > > http://www.societopia.net
    > > > > http://www.webswapp.com
    > > > >
    > > > >
    > > > > "Cam" wrote:
    > > > >
    > > > > > in a grid with templates update,delete, edit. why the buttons need to be
    > > > > > clicked twice in order to take action.
    > > > > >
    > > > > > grid.item command fires up every time a button is clicked.
    > > > > > it's just the button action that don't execute....
    > > > > >
    > > > > > anyone else had that issue?
    Phillip Williams, Dec 28, 2005
    #6
  7. Cam

    Cam Guest

    Hi!
    AutoEventWireup was and is =false.
    Oninit has
    this.Load += new System.EventHandler(this.Page_Load);

    setting AutoEventWireup to true did not help the issue.
    i tried on postback contrary to !postback... still nothing
    -------------------------------------------------
    all other controls on the page outside the grid work fine
    it's the controls inside the grid that require a double click.
    the causevalidation property is set to true
    a couple of folks had the same issue in the forum but no solution was
    provided...

    Thanks


    "Phillip Williams" wrote:

    > Check the AutoEventWireup value in the page directive and the OnInit method
    > within the "Web Form Designer generated Code" region. If the AutoEventWireUp
    > were set to "true" and the OnInit has this line of code in it:
    >
    > this.Load += new System.EventHandler(this.Page_Load);
    >
    > If that is the case then your application is calling the Page_Load twice
    > thereby messing up the databinding sequence that you have. If it turns out to
    > be the case you can either set the AutoEventWireUp=â€false†or remove wiring
    > up the event handling in the OnInit method.
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Cam" wrote:
    >
    > > page_load(....){
    > > if(!ispostback){
    > > refrreshgrid();
    > > }
    > > }
    > >
    > > thanks
    > > "Phillip Williams" wrote:
    > >
    > > > Is the grid placed on the webform dynamically or declaratively? When the
    > > > page is loaded how do you call the refreshgrid method and during which event
    > > > handling?
    > > > --
    > > > HTH,
    > > > Phillip Williams
    > > > http://www.societopia.net
    > > > http://www.webswapp.com
    > > >
    > > >
    > > > "Cam" wrote:
    > > >
    > > > > v 1.1
    > > > > void refreshgrid(){
    > > > > grid.datasource = ds (populated dataset)
    > > > > grid.databind.
    > > > > }
    > > > > grid_itemcommand(object source,
    > > > > System.Web.UI.WebControls.DataGridCommandEventArgs e){
    > > > > switch(e.commandname){
    > > > > case "update":
    > > > > //stepped through here.. update the dbase
    > > > > refreshgrid(); //though executed... doesn't refresh.
    > > > > break;
    > > > > }
    > > > > }
    > > > > if i close the browser and open the page again... the change made is
    > > > > displayed.
    > > > > click on edit once... nothing. twice then edit box is there.
    > > > > click on save onece... nothing. twice it saves and don't display...
    > > > > never seen this b 4
    > > > > "Phillip Williams" wrote:
    > > > >
    > > > > > The answer depends on which asp.net version are you using and how do you
    > > > > > databind the grid?
    > > > > >
    > > > > > --
    > > > > > HTH,
    > > > > > Phillip Williams
    > > > > > http://www.societopia.net
    > > > > > http://www.webswapp.com
    > > > > >
    > > > > >
    > > > > > "Cam" wrote:
    > > > > >
    > > > > > > in a grid with templates update,delete, edit. why the buttons need to be
    > > > > > > clicked twice in order to take action.
    > > > > > >
    > > > > > > grid.item command fires up every time a button is clicked.
    > > > > > > it's just the button action that don't execute....
    > > > > > >
    > > > > > > anyone else had that issue?
    Cam, Dec 29, 2005
    #7
  8. Cam

    Cam Guest

    found the solution..... delete the page and rebuilt it. it works fine same
    codes.....

    thanks

    "Cam" wrote:

    > Hi!
    > AutoEventWireup was and is =false.
    > Oninit has
    > this.Load += new System.EventHandler(this.Page_Load);
    >
    > setting AutoEventWireup to true did not help the issue.
    > i tried on postback contrary to !postback... still nothing
    > -------------------------------------------------
    > all other controls on the page outside the grid work fine
    > it's the controls inside the grid that require a double click.
    > the causevalidation property is set to true
    > a couple of folks had the same issue in the forum but no solution was
    > provided...
    >
    > Thanks
    >
    >
    > "Phillip Williams" wrote:
    >
    > > Check the AutoEventWireup value in the page directive and the OnInit method
    > > within the "Web Form Designer generated Code" region. If the AutoEventWireUp
    > > were set to "true" and the OnInit has this line of code in it:
    > >
    > > this.Load += new System.EventHandler(this.Page_Load);
    > >
    > > If that is the case then your application is calling the Page_Load twice
    > > thereby messing up the databinding sequence that you have. If it turns out to
    > > be the case you can either set the AutoEventWireUp=â€false†or remove wiring
    > > up the event handling in the OnInit method.
    > >
    > > --
    > > HTH,
    > > Phillip Williams
    > > http://www.societopia.net
    > > http://www.webswapp.com
    > >
    > >
    > > "Cam" wrote:
    > >
    > > > page_load(....){
    > > > if(!ispostback){
    > > > refrreshgrid();
    > > > }
    > > > }
    > > >
    > > > thanks
    > > > "Phillip Williams" wrote:
    > > >
    > > > > Is the grid placed on the webform dynamically or declaratively? When the
    > > > > page is loaded how do you call the refreshgrid method and during which event
    > > > > handling?
    > > > > --
    > > > > HTH,
    > > > > Phillip Williams
    > > > > http://www.societopia.net
    > > > > http://www.webswapp.com
    > > > >
    > > > >
    > > > > "Cam" wrote:
    > > > >
    > > > > > v 1.1
    > > > > > void refreshgrid(){
    > > > > > grid.datasource = ds (populated dataset)
    > > > > > grid.databind.
    > > > > > }
    > > > > > grid_itemcommand(object source,
    > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs e){
    > > > > > switch(e.commandname){
    > > > > > case "update":
    > > > > > //stepped through here.. update the dbase
    > > > > > refreshgrid(); //though executed... doesn't refresh.
    > > > > > break;
    > > > > > }
    > > > > > }
    > > > > > if i close the browser and open the page again... the change made is
    > > > > > displayed.
    > > > > > click on edit once... nothing. twice then edit box is there.
    > > > > > click on save onece... nothing. twice it saves and don't display...
    > > > > > never seen this b 4
    > > > > > "Phillip Williams" wrote:
    > > > > >
    > > > > > > The answer depends on which asp.net version are you using and how do you
    > > > > > > databind the grid?
    > > > > > >
    > > > > > > --
    > > > > > > HTH,
    > > > > > > Phillip Williams
    > > > > > > http://www.societopia.net
    > > > > > > http://www.webswapp.com
    > > > > > >
    > > > > > >
    > > > > > > "Cam" wrote:
    > > > > > >
    > > > > > > > in a grid with templates update,delete, edit. why the buttons need to be
    > > > > > > > clicked twice in order to take action.
    > > > > > > >
    > > > > > > > grid.item command fires up every time a button is clicked.
    > > > > > > > it's just the button action that don't execute....
    > > > > > > >
    > > > > > > > anyone else had that issue?
    Cam, Dec 29, 2005
    #8
    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. Girish
    Replies:
    4
    Views:
    667
    Patrick.O.Ige
    Jul 19, 2005
  2. =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=

    How to transfer a value from an Invisible Grid to an visible Grid

    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=, Oct 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    463
    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=
    Oct 17, 2005
  3. Danny Tuppeny

    Grouped grid? Or grid within datalist?

    Danny Tuppeny, Oct 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    495
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Oct 27, 2005
  4. Marc
    Replies:
    0
    Views:
    450
  5. Simon L
    Replies:
    3
    Views:
    403
    Jeff Flinn
    Mar 31, 2006
Loading...

Share This Page