Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > grid postback

Reply
Thread Tools

grid postback

 
 
Cam
Guest
Posts: n/a
 
      12-28-2005
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?
 
Reply With Quote
 
 
 
 
Phillip Williams
Guest
Posts: n/a
 
      12-28-2005
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?

 
Reply With Quote
 
 
 
 
Cam
Guest
Posts: n/a
 
      12-28-2005
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?

 
Reply With Quote
 
Phillip Williams
Guest
Posts: n/a
 
      12-28-2005
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?

 
Reply With Quote
 
Cam
Guest
Posts: n/a
 
      12-28-2005
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?

 
Reply With Quote
 
Phillip Williams
Guest
Posts: n/a
 
      12-28-2005
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?

 
Reply With Quote
 
Cam
Guest
Posts: n/a
 
      12-29-2005
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?

 
Reply With Quote
 
Cam
Guest
Posts: n/a
 
      12-29-2005
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a container to hold grid positions and the objects on the grid? Simon L C++ 3 03-31-2006 03:38 PM
Grouped grid? Or grid within datalist? Danny Tuppeny ASP .Net 1 10-27-2005 10:03 PM
How to transfer a value from an Invisible Grid to an visible Grid =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?= ASP .Net 2 10-17-2005 03:56 AM
Grid within a Grid ItemDataBound event problem Girish ASP .Net 4 07-19-2005 01:17 AM
Grid question: How do I force grid elements to expand and use available space Marc Python 0 10-08-2003 05:06 PM



Advertisments