How should I display datatable in multiple pages? - asp.net

IN summary . I have an ASPX page. and a button. Clicking the button will load the result based on the parameter the user specified. The problem is if the result is too much, the page is too slow to load.
AS I am writing my question. basically I need suggestion as to which approach is the best practice?
OPTION 1 is it possible for the ASPX page to load in chunks and as the user scroll, more result will be displayed. if so, where do I start reading and how do I do it?
OPTION 2 fix the function behind the button to display 10 records at a time. and add another button such as next page or previous page
OPTION 3 It would be nice , if I know what I am doing, is to show progress to the user, what the code is doing . a nice progress bar.. showing loading .. 10% done, 20% done.. 100% done.. . at least the user is not just watching Internet explorer spinning icon...
ugh, Apologize as this becomes a really long post..
I have a function that loop through a datatable (DT). Lets call this function displayImages.
The DT may have 200 records. what's inside DT, is a list of filenames.
DisplayImages function, determine where the file is located and display the result into the user. The end result is HTML tag like
img src="path/filename.jpg"
I have other routines in displayimages function, but for the sake of simplicity lets just say the displayimages function only loops through DT and spits out the img src="path/filename.jpg"
The problem I am currently having is that displayimages function is too slow to complete all 200 results. And my attempt to give the user some feedback to show where the loop is at has not work very well (I don't know how to make a nice progress bar to show end user what the loop is doing inside displayimages function)
So I have this Idea of displayimages function to show only 10 records at a time. and a user then click a link button or ASPX button. page 1 , page 2 and show on, to display the next result.
I read I can use pagingdatasource. but I am wondering if there is a clever way to just loop the datatable from row 1 to 10
then row 11 to 20
and so on...
I guess my problem is how can I keep that datatable in memory so I can keep referring to it.
I do have an identifier set in the datatable if that can be any help?
Please let me know your suggestion.. Thank you
This is an ASPX website with VB.net code behind
Thanks in advance

In the end I end up with option number 2.
I am not using sql data source in my code. but I only use datatable.
so to achieve option 2 (which is to display 10 records at one time. and the user has the ability to click page 1 page 2 page 3) I use gridview and css.
Gridview is set to display 10 results at one time.
And as the gridview is irrelevant for the user I use CSS to hide all the contents. but only show the pagination row (the last row)
as I am learning to code in asp.net and vb.net I wish to be able to do option 1 or option 3.
I am hoping I will be able to learn how to do it in the near future.
Thanks!

Related

I need to display a pop up table on clicking a button in vb.net. How do i do this without the gridviews just on plain button click?

I need a table to pop up or flash on the users screen when a button is clicked
It is a reference table, users can go back and check the codes while filling a form. This is to be done vb.net. Please help me i need the simplest solution possible
in my opinion:
1) If you don't insist on formatting and you would like to only display table data, you can simply write the data into string, which you will display in a MsgBox dialog. You'll probably will have to take care about partial string lenghts in columns (trim, or complete with spaces to a specific length) and then it will look OK. Bellow is an example of such data (only a test dialog) without any trimming/completeng:
2) For a serious table, you'd have to either use datagrdiveiw (or such) in a separate form, or draw your table using GDI, which would be a rather complicated and eccentric method.

ASP.net Search TextBox and Object that contains result

Currently, I have a simple DropDownList, which contains around 100 entries. Searching for a specific entry is really uncomfortable and takes up alot of time, so I'm searching for the easiest/most efficient way to realize the following idea:
There are a few things you can see here, which I only show for a clear explanation. The only thing I want to know about is point 2 (question further down).
This is the Textbox I want to be able to search something with
This is the Object in which I want to show the result
The result consists of pictures. In the searchbox I can type in "Symbol1" and the result will be the picture Symbol1.png.
When hovering over, a note should pop up
A scrollbar should be available to scroll down inside that object
This is the result I want to achieve. My question is the following:
What kind of object would be most optimal to use for my example?
I have looked into various possible solutions (Popup window, Searchable DropDownList, etc.), but I haven't found out which object I should use to show the result of a search in form of pictures.

How to perform keyboard actions (Page Down,Page UP) in robotframework?

Question 1:
I have to verify keyboard actions for my web application. Any inputs on how to perform keyboard actions using robot framework would be helpful.
Question 2:
Scenario: There are 500 items in the list which can be selected by using checkbox. I have written a script to select 25 items using loop, it worked. Same script doesn't work when it is configured to 40 items. Looks like only 27 items in list are accommodated in page. Next page with items are fetched only as we scroll down or Page down is pressed in keyboard. Scroll bar/scroller is not an identifiable element, so couldn't perform scroll operation using script. So, I thought of performing two operations(Selecting checkbox and Page down) in a loop. Kindly suggest any inputs to perform this...
Press key keyword is useful for your task.
Refer here for complete details.

DataRepeater becomes empty

I'm using a DataRepeater control in my VB.Net application so I can make a custom-made list control.
I know it's main functionality is to work with dataSets and stuff, but I don't actually want to transfer my stuff into a database because in the program's context it doesn't actually make any sense.
So my goal here is to use a dataRepeater to list the contents of a mail inbox.
Everything works just fine until I scroll down the control. As I scroll down/up to see every item (in this case, every listed e-mail), the contents disappear and all I can see is a bunch of lines with the controls' default values assigned - like "Label1" and so on.
This is how I'm filling the dataRepeater (abreviated):
For each m as Message in mail.Inbox
dr.Addnew()
With dr.CurrentItem
.Controls("lblFrom") = m.From
.Controls("lblSubject") = m.Subject
End With
Next
As I said, the dataRepeater shows up perfect until I scroll it up/down, and when I do it all the data just disappears remaining only the items with the controls' default (design-time) values.
Am I missing something here? Or is it just not possible to work with a dataRepeater to fulfil my idea?
UPDATE:
Got my answer right here!
The repeater isn't going to hold the values on its own. You dont have to use a datasource, but you have to use something. Here is an example where they used a simple integer array: VB.NET Repeater Simple Data Binding Without Datasource

does DevExpress XtraReports have an easily accessible notion of "current detail report being printed"?

I am printing a details subreport that gets printed let's say 5 times on the overall report, for 5 query results. I compute some stuff for it with my code, and so I use BeforePrint event on an XRTable widget that I have in that subreport. So far so good.
What I don't like is that when the BeforePrint executes for that table for the first time and I change its cells' text to something, that this renders on all subsequent instances of this report and table being printed. Now, obviously, since BeforePrint gets called again, I get the opportunity to reset the text to what it should be. So this is not a show stopper.
Yet, this somehow fills wrong, and an invitation to bugs. Is there a way for me to explicitly access "the instance of the table/other widget being printed" rather than "the widget in general, with changes being rendered in all instances that it prints"?
Indeed, you are right. If the formatting should be based on the earlier created data or summary, formatting rules won't work. A possible solution to this problem is to implement a special approach when a developer manually browses all printing system bricks and changes their content manually. You will find some examples on how this can be done at:
Implementing Page totals
subtotal on page bottom and on next page on top

Resources