Sorry about the multi-posting, but it does not seem as though the other
newsgroups are frequented enough to get any advice on this problem...If
anyone can possibly help, I would greatly appreciate it, I've spent three
days trying figure out why paging won't work for me...TIA.
I've been to gotdotnet.com/quickstart...sa mples and reviewed the Source
control for adding paging to datagrids, my problem is that we do not connect
to an SQL Server, we are using an RPC to get the data from a DB2 database
using COBOL. It is a difficult way to get connected, and causes problems
when I'm trying to do something that's supposed to be as simple as paging
for a datagrid. When I select the page number to go to, I get a blank
screen, with Currentpageinde x is 1 and PageCount is 0. Why doesn't it page
correctly? Here is my code...Any suggestions?
Dim lo_AZRM001A_SEL As MotorFuel.AZRM0 01A_SEL
Dim lo_misc_func As MotorFuel.misc_ func
Dim ds_mc As DataSet
Dim dt_mc As New DataTable()
Dim createdataview as DataView
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
uf_get_supplier _list()
End If
End Sub
Private Sub uf_get_supplier _list()
'This function gets the Withdrawal listing if available.
'Define the local variables.
Dim li_no_row As Integer = 0
Try
'Instantiate an RPC to get an Withdrawal Listing.
lo_AZRM001A_SEL = New MotorFuel.AZRM0 01A_SEL()
lo_misc_func = New MotorFuel.misc_ func()
Catch
'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End Try
'Set the data to the Data Grid if the li_no_row is not equal "0".
If li_no_row <> 0 Then
If Page.IsPostBack = False Then
dt_mc = lo_AZRM001A_SEL .get_ddl_sel_su p
dtg_load_data()
End If
End If
'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End Sub
Private Sub btn_sel_sup_ok_ Click(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btn_sel_sup_ok. Click
Response.Redire ct("../Common/mc_rpt_period.a spx")
End Sub
Sub dtg_load_data()
dtg_sel_sup.Dat aSource = dt_mc
dtg_sel_sup.Dat aKeyField = "BusinessID "
dtg_sel_sup.Dat aMember = "BusinessNa me"
dtg_sel_sup.Dat aMember = "Account"
dtg_sel_sup.Dat aBind()
createdataview = New DataView(dt_mc)
'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End Sub
Sub dtg_sel_sup_Pag e(ByVal sender As Object, ByVal e As
DataGridPageCha ngedEventArgs)
dtg_sel_sup.Cur rentPageIndex = e.NewPageIndex
bindgrid()
End Sub
Sub bindgrid()
dtg_sel_sup.Dat aSource = createdataview
dtg_sel_sup.Dat aBind()
showstats()
End Sub
Sub showstats()
lblcurrentindex .Text = "CurrentpageInd ex is " &
dtg_sel_sup.Cur rentPageIndex
lblpagecount.Te xt = "PageCount is " & dtg_sel_sup.Pag eCount
End Sub 4 1509
you need to re-populate createdataview in your databind()
method. Otherwise, it has no data in it.
Tu-Thach -----Original Message----- Sorry about the multi-posting, but it does not seem as
though the othernewsgroups are frequented enough to get any advice on
this problem...Ifanyone can possibly help, I would greatly appreciate it,
I've spent threedays trying figure out why paging won't work for me...TIA.
I've been to gotdotnet.com/quickstart...sa mples and
reviewed the Sourcecontrol for adding paging to datagrids, my problem is
that we do not connectto an SQL Server, we are using an RPC to get the data
from a DB2 databaseusing COBOL. It is a difficult way to get connected, and
causes problemswhen I'm trying to do something that's supposed to be as
simple as pagingfor a datagrid. When I select the page number to go to,
I get a blankscreen, with Currentpageinde x is 1 and PageCount is 0.
Why doesn't it pagecorrectly? Here is my code...Any suggestions?
Dim lo_AZRM001A_SEL As MotorFuel.AZRM0 01A_SEL Dim lo_misc_func As MotorFuel.misc_ func Dim ds_mc As DataSet Dim dt_mc As New DataTable() Dim createdataview as DataView
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e AsSystem.EventAr gs) Handles MyBase.Load If Not Page.IsPostBack Then uf_get_supplier _list() End If End Sub
Private Sub uf_get_supplier _list() 'This function gets the Withdrawal listing if available. 'Define the local variables. Dim li_no_row As Integer = 0 Try 'Instantiate an RPC to get an Withdrawal Listing. lo_AZRM001A_SEL = New MotorFuel.AZRM0 01A_SEL() lo_misc_func = New MotorFuel.misc_ func() Catch 'Destroy the objects. lo_AZRM001A_SEL = Nothing lo_misc_func = Nothing End Try 'Set the data to the Data Grid if the li_no_row is not
equal "0".If li_no_row <> 0 Then If Page.IsPostBack = False Then dt_mc = lo_AZRM001A_SEL .get_ddl_sel_su p dtg_load_data() End If End If 'Destroy the objects. lo_AZRM001A_SE L = Nothing lo_misc_func = Nothing
End Sub
Private Sub btn_sel_sup_ok_ Click(ByVal sender As
System.Object, ByVal e AsSystem.EventAr gs) Handles btn_sel_sup_ok. Click Response.Redire ct("../Common/mc_rpt_period.a spx") End Sub
Sub dtg_load_data() dtg_sel_sup.Dat aSource = dt_mc dtg_sel_sup.Dat aKeyField = "BusinessID " dtg_sel_sup.Dat aMember = "BusinessNa me" dtg_sel_sup.Dat aMember = "Account" dtg_sel_sup.Dat aBind() createdataview = New DataView(dt_mc) 'Destroy the objects. lo_AZRM001A_SEL = Nothing lo_misc_func = Nothing End Sub
Sub dtg_sel_sup_Pag e(ByVal sender As Object, ByVal e As DataGridPageCh angedEventArgs) dtg_sel_sup.Cur rentPageIndex = e.NewPageIndex bindgrid() End Sub
Sub bindgrid() dtg_sel_sup.Dat aSource = createdataview dtg_sel_sup.Dat aBind() showstats() End Sub
Sub showstats() lblcurrentindex .Text = "CurrentpageInd ex is " & dtg_sel_sup.Cu rrentPageIndex lblpagecount.Te xt = "PageCount is " &
dtg_sel_sup.Pag eCountEnd Sub .
So here - I need to do something like this?
Sub dtg_load_data()
dtg_sel_sup.Dat aSource = dt_mc
dtg_sel_sup.Dat aKeyField = "BusinessID "
dtg_sel_sup.Dat aMember = "BusinessNa me"
dtg_sel_sup.Dat aMember = "Account"
createdataview = New DataView(dt_mc)
dtg_sel_sup.Dat aBind()
I'm not really sure, since I had already re-bound the datagrid only
difference is that I changed the position of the databind. I'm having
trouble getting a connection to our database right now, so I can't test it.
If this is not what you meant, could you please give me an example? Thanks
very much for the assistance :-)
Coleen
"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. . you need to re-populate createdataview in your databind() method. Otherwise, it has no data in it.
Tu-Thach
Look at your function for handling page change, you have
Sub dtg_sel_sup_Pag e(ByVal sender As Object, ByVal e As
DataGridPageCha ngedEventArgs)
dtg_sel_sup.Cur rentPageIndex = e.NewPageIndex
bindgrid()
End Sub
which calls bindgrid() to bind your datagrid. The
bindgrid method:
Sub bindgrid()
dtg_sel_sup.Dat aSource = createdataview
dtg_sel_sup.Dat aBind()
showstats()
End Sub
In this method, you set the datasource for your grid to
the variable createdataview. Nowhere in this code did you
initialize data for the variable createdataview.
Therefore, when you bind the datagrid, it does not have
any data and that's why the datagrid shows nothing. You
need to do something similar to your dtg_load_data()
method.
Tu-Thach -----Original Message----- So here - I need to do something like this? Sub dtg_load_data() dtg_sel_sup.Dat aSource = dt_mc dtg_sel_sup.Dat aKeyField = "BusinessID " dtg_sel_sup.Dat aMember = "BusinessNa me" dtg_sel_sup.Dat aMember = "Account" createdataview = New DataView(dt_mc) dtg_sel_sup.Dat aBind()
I'm not really sure, since I had already re-bound the
datagrid onlydifference is that I changed the position of the
databind. I'm havingtrouble getting a connection to our database right now,
so I can't test it.If this is not what you meant, could you please give me
an example? Thanksvery much for the assistance :-)
Coleen
"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in
messagenews:02******* *************** ******@phx.gbl. .. you need to re-populate createdataview in your databind
() method. Otherwise, it has no data in it.
Tu-Thach
.
Umm, I totally missed that - Thanks! I guess that's what happens when you
try to do too much multi-tasking...
"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. . Look at your function for handling page change, you have
Sub dtg_sel_sup_Pag e(ByVal sender As Object, ByVal e As DataGridPageCha ngedEventArgs) dtg_sel_sup.Cur rentPageIndex = e.NewPageIndex bindgrid() End Sub
which calls bindgrid() to bind your datagrid. The bindgrid method:
Sub bindgrid() dtg_sel_sup.Dat aSource = createdataview dtg_sel_sup.Dat aBind() showstats() End Sub
In this method, you set the datasource for your grid to the variable createdataview. Nowhere in this code did you initialize data for the variable createdataview. Therefore, when you bind the datagrid, it does not have any data and that's why the datagrid shows nothing. You need to do something similar to your dtg_load_data() method.
Tu-Thach
-----Original Message----- So here - I need to do something like this? Sub dtg_load_data() dtg_sel_sup.Dat aSource = dt_mc dtg_sel_sup.Dat aKeyField = "BusinessID " dtg_sel_sup.Dat aMember = "BusinessNa me" dtg_sel_sup.Dat aMember = "Account" createdataview = New DataView(dt_mc) dtg_sel_sup.Dat aBind()
I'm not really sure, since I had already re-bound the datagrid onlydifference is that I changed the position of the databind. I'm havingtrouble getting a connection to our database right now, so I can't test it.If this is not what you meant, could you please give me an example? Thanksvery much for the assistance :-)
Coleen
"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in messagenews:02******* *************** ******@phx.gbl. .. you need to re-populate createdataview in your databind () method. Otherwise, it has no data in it.
Tu-Thach
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ricardo Manuel |
last post by:
Hi,
I'm using a Datagrid that I fill with a Dataset but
when I configure the paging with the Navigation Buttons I
can't put them working, I've tried both methods (Next,
Previous and Page Numbers) when I click on the Next link
of the navigation buttons I see on status bar the
folowing code -> Javascript:__doPostBack('Datagrid1$_ctl9
$_ctl1','') but nothing happens on Datagrid.
I've configured the datagrid for 5 rows and Dataset
|
by: Stephen |
last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try
and understand what im trying to do and give me a few pointers or ideas to
help me work out my problem.
Im basically using the example of CUSTOM PAGING on a DataGrid on this page:
http://www.dotnetjunkies.com/Tutorial/EA868776-D71E-448A-BC23-B64B871F967F.dcik
and im trying to add extra functionality in the DataGrid Paging - Custom
Paging example. I'm able to get...
|
by: Joseph D. DeJohn |
last post by:
I am trying to get pagination working on a datagrid. Can anyone point me to
a resource for help on this? I'm not sure if custom paging is the best
option or not.
|
by: Maziar Aflatoun |
last post by:
Hi,
I have a Datagrid with AllowPaing property set so that the two arrows for
the next and previous set of rows are showing. This is working fine. Now
is there a way to instead of the 2 default previous/next arrows to use
images to represent this previous and next property of the DataGrid?
Thank you
Maziar A.
|
by: Patrick.O.Ige |
last post by:
Hi Guys,
I have a datagrid wit editing and updating.
But after adding Paging IT WON'T PAGE!!
It compiles well but when i click on the paging link it doesn't go to the
next link..
When i remove AllowCutomPaging it gives error:-
"AllowCustomPaging must be true and VirtualItemCount must be set for a
DataGrid with ID MenuGrid when AllowPaging is set to true and the selected
datasource does not implement ICollection"
| |
by: Shawn |
last post by:
Hi.
I already have a datagrid where I'm using paging. I have a stored procedure
that fills a temp table with 200-500 rows and then sends back 10 records at
the time. When I go to page 2 the SP fills the temp table again and returns
rows 10-19. The temp table is dropped after each call to the SP, so it has
to be created and filled every time the user changes page in the datagrid.
My question is this: Would it be more efficient to...
|
by: tshad |
last post by:
Is there a way to carry data that I have already read from the datagrid from
page to page?
I am looking at my Datagrid that I page through and when the user says get
the next page, I have to go to the database to get the next page. Is there
a way to use the dataset to allow us to read back and forth in it instead of
going back to the database to get it?
Thanks,
|
by: coleenholley |
last post by:
Hi All :-)
I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has to be laid out as follows:
Header Row Header Row
Static data Dynamic (read only) data
<Break>
Header Row Header Row Header Row Header Row
|
by: ashish.dwivedi1 |
last post by:
Hi,
I am building a ASP .NET composite control containing a datagrid during
which I am
finding a problem while paging of the grid.
The problem is for example if I am having three pages to be displayed
in the
datagrid, I have set the paging mode to be numeric.Now I am going to
have
|
by: getziiiiiiiiiii |
last post by:
Hi There. . I need some help in paging (which is not working) in
ASP:DATAGRID
My Data source id is a function which returns DataTable to this
datagrid.
Do i need a code behind to get the next page working?
thanks for help.
this is how my data grid look like:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |