Home All Groups Group Topic Archive Search About
Author
28 Dec 2005 7:47 PM
Cam
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?

Author
28 Dec 2005 8:57 PM
Phillip Williams
The answer depends on which asp.net version are you using and how do you
databind the grid?

Show quoteHide quote
"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?
Author
28 Dec 2005 9:24 PM
Cam
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
Show quoteHide quote
"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?
Author
28 Dec 2005 9:56 PM
Phillip Williams
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?
Show quoteHide quote
"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?
Author
28 Dec 2005 10:04 PM
Cam
page_load(....){
if(!ispostback){
  refrreshgrid();
}
}

thanks
Show quoteHide quote
"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?
Author
28 Dec 2005 10:35 PM
Phillip Williams
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.

Show quoteHide quote
"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?
Author
29 Dec 2005 3:40 PM
Cam
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


Show quoteHide quote
"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?
Author
29 Dec 2005 7:05 PM
Cam
found the solution..... delete the page and rebuilt  it. it works fine same
codes.....

thanks

Show quoteHide quote
"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?