CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Moving to a record in a grid via code.

Print topic Send  topic

Author Message
Bo Ugljesic
Posted: 08/06/2002, 12:26 PM

Hello All,

I have a form with a record (customer) and a grid(products) below it. When a
link on the grid is clicked the form that edits the product is displayed.
When the edit form is submitted it goes back to the grid form.

Now for the problem, when the edit form returns to the grid form the grid
resets back to page 1 of the grid and not on the page where the record
originated. How can the grid be set to originating record.

Thanks,
Bo



Bo Ugljesic
Posted: 08/06/2002, 12:33 PM

Forgot:
Lanugage C# ASP.NET
CCS 1.07


DonB
Posted: 08/06/2002, 5:45 PM

You should have a query-string item in the URL that references the current
page number, if your grid is named "grd", then the element will be grdPage.
If you preserve parameters between forms, then you should return to the
same page that you left. Look for something like "?grdPage=2" on the URL.
If it is not there, then you could

The other way would be custom "Before Execute Select" code that sets the
navigator's PageNumber property:

grd.Navigator.PageNumber = n ' Where 'n' is the page you want to go
to.

I suppose you could keep 'n' in a session variable. For this, you'd
probably also save the variable in the "After Execute Select" event to have
it available for the next time the "before" event gets called:

grd.Navigator.PageNumber = Session("grd_currentpage") ' This line in
the Before event
Session("grd_currentpage") = grd.Navigator.PageNumber ' This line the
After event

"Bo Ugljesic" <service@altekcomputer.com> wrote in message
news:aip8a5$lqt$1@news.codecharge.com...
> Forgot:
> Lanugage C# ASP.NET
> CCS 1.07
>
>
>

Bo Ugljesic
Posted: 08/07/2002, 11:10 AM

Hello DonB,

Thanks for the reply.

> You should have a query-string item in the URL that references the current
> page number, if your grid is named "grd", then the element will be
grdPage.
> If you preserve parameters between forms, then you should return to the
> same page that you left. Look for something like "?grdPage=2" on the URL.
> If it is not there, then you could
>

How can the page number be sent through a link. What would be the source
type and parameter source in the link parameter dialog box. The grid name
is MATERIAL1.

I tried:

Various Source types

Parameter Source:

Page
PageNumber
MATERIAL1PageNumber
MATERIAL1Page
MATERIAL1.PageNumber
MATERIAL1.Page
MATERIAL1.Navigator.PageNumber
MATERIAL1.Navigator.Page



The parameter name is sent to the edit page but is blank ( grdPageN=)

Thanks,
Bo




DonB
Posted: 08/07/2002, 7:45 PM

The URL should show MATERIAL1Page=3 (or whatever page you are on). CCS has
complete control over the paging (i.e., it's all set up automatically). So
if you are not seeing the above query string being generated, then you may
not have built the grid correctly. Did you use the application wizard, the
grid builder, or use the Add Grid Form tool to create your grid?

I just did a quick test on the CCS database: (1) a simple grid and (2) a
record maintenance/view page - all done with the application wizard. I made
one column of the grid a link to the maint form.

The behavior is that when I navigate the grid to a given page, then click
the link to go to the maint page, I am returned to the grid on the same page
I left. CCS did it all for me.

You may have "damaged" ;-) the code CCS built so that this function does not
work for that page anymore. This may be because you edited the code (is any
of it not the "gray" background, indicating it was changed after CCS built
it?)

If you care to post the form in question, I'll take a look at it to see if I
can find anything wrong with it.

don

"Bo Ugljesic" <service@altekcomputer.com> wrote in message
news:airnqi$32h$1@news.codecharge.com...
> Hello DonB,
>
> Thanks for the reply.
>
> > You should have a query-string item in the URL that references the
current
> > page number, if your grid is named "grd", then the element will be
> grdPage.
> > If you preserve parameters between forms, then you should return to the
> > same page that you left. Look for something like "?grdPage=2" on the
URL.
> > If it is not there, then you could
> >
>
> How can the page number be sent through a link. What would be the source
> type and parameter source in the link parameter dialog box. The grid name
> is MATERIAL1.
>
> I tried:
>
> Various Source types
>
> Parameter Source:
>
> Page
> PageNumber
> MATERIAL1PageNumber
> MATERIAL1Page
> MATERIAL1.PageNumber
> MATERIAL1.Page
> MATERIAL1.Navigator.PageNumber
> MATERIAL1.Navigator.Page
>
>
>
> The parameter name is sent to the edit page but is blank ( grdPageN=)
>
> Thanks,
> Bo
>
>
>
>
>

Bo Ugljesic
Posted: 08/08/2002, 5:00 AM

Hello Don,

I tried through application wizard and still did not get the page number as
a parameter. Here is what ended up working with help from Nicole on the
forum.

Source Type: Expression
Parameter Source: MATERIAL1Data.PageNumber
Parameter Name: MATERIAL1Page

The Parameter Name has to be gridname+Page for it to return to the same page
after post of the edit form.

Thank You! Your responses have been appreciated.
Bo

Bo Ugljesic
Posted: 08/08/2002, 5:09 AM

Hi Don,

Also your hint of "grdPage" gave me the answer to call the parameter
MATERIALqPage

Bo


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.