how to hide the numeric pager in list view - asp.net

I am using a list view with page size 10 and added a numeric data pager for paging.everything is working fine but how i can hide the page number shown below when the data in list view is less than 10 and show it only data is greater than 10.
pls help me out....

You would attach to PagePropertiesChanged event of the ListView and retrieve the number of items displayed in the current page. If the number is less than 10, set Visible to false of the DataPager.
Sorry for my english.

Related

gridview paging inside the list view in aspx

is it possible to have grid view pagging function inside a list view in asp.net.
i have two column subject and lesson.
i have more than 30 subjects and each subject contains more than 100 lesson.
i want to load the subject list and as soon as i click on any subject the lesson belong to each subject show.
as of now 100 subjects are showing, is it possible that i can have a pagging so that i can see 20 20 subject in each layout while not uploading/refreshing the whole webpage.
you can see the live page where i want to do it at
http://gvapps.zapto.org:801/studywiser/home.aspx
is there any way possible that grid view pagging works inside the list view.
though i am not the programmer i am writing this question on behalf of my programmer who is telling me its not possible to have it.
any suggestion or answer will be highly appreciated.
thank you
yasir

Dropdownlist display issues in IE 10

I am running a .net web application on IE10. The issue seems to be with the way the items are being displayed in the dropdownlist. In IE10 if an item is chosen from the list which happens to be in middle (say you are choosing the 3rd item out of 5) and then again click on drop down list then the list spans as 2 elements above this value and 2 below. Also if you choose the very last item and then again click on the drop down the list is displayed as all the items above the last item and then the last item in the field (list is displayed upwards).
So the issue appears when these items are displayed after choosing them and clicking again on the control just to see all the items.
In IE8 and 9 it is like the item chosen is displayed in the field
and then the whole list follows below this.
Please help...
I also meet this problem.
But when I search here, it is said be design. I don't know if it is true, but I couldn't find anyway to fix it.

limit the record displayed in a view using hook_views_query_alter

i want to change the number of items returned by a view. I changed the code as
$view->set_items_per_page(2);
in hook_views_query_alter();
But it is not showing the required result. But there is color difference after 2 records. Is it required any other settings I put my pager as off in view.
ie Use Pager:off . I want to use this on draggable view table. Is it possible?
Pls help me
if you are only altering the query programmatically and view exist then
1] Go to your view basic settings and click on item to display
bottom of your view you will get the 2 text boxes.
2] In first text box put the number you want, in your case put 2 and leave second text box 0. and hit the update default display button and save your view.

Custom Controls and States

I've got an <mx:Button> in my application, I have 10 items in an XML Node. What I'd like to do is when the button is clicked show the next 5 XML Nodes.
How do I achieve this?
My code is as follows at the mo :
<mx:Button x="1380.65" y="582.65" styleName="rightButton"/>
The style is just setting the up / over and down states of the button. But I want it to function and show the XML nodes in groups of 5.
How are you displaying the first five items?
If you're displaying things in a list or DataGrid, I believe you can set the verticalScrollPosition to scroll the list via a button click.
If you are displaying items using TextInputs, custom component, or other non-renderer-based classes, you just need to manually write some code to update the display elements based on the currently displayed index and what is next.
Can you offer a running sample? That may us direct you!

Control the number of displayed rows in a dropdown

Is there a way to control the number of displayed rows in a DropDownList control? I'd like it to only display 10 rows, but it defaults to 30. This causes the list to appear higher than the control instead of below it because of its position on the page.
You can do pagination on the data source for the drop down list using PagedDataSource and set the PageSize to 10.
If ASP.NET renders a DropDownList control as a <select> then there is no way to control the number of rows shown when the <select> is opened, it is browser-implementation dependant.
A quick test shows that IE 6 reveals 27 items from a 27 item list, Safari for Windows 3.2.1 reveals 22, Firefox 2 reveals 20 and Opera 9.6.2 reveals 16. The number revealed may even depend on the total number of items, but I didn't bother to test that because it is pretty obvious this isn't something you're going to be able to control.
Adding size="..." to the control will make the drop-down list a fixed size and it will no longer be a "drop-down list" (assuming you can even do that).
The only solution to this seems to be to implement a JavaScript-based pull-down control of your own, or buy or download one.
Note:
I have not tried this using code
Add "size" attribute with "10" as value to show 10 rows in the dropdown.
<asp:dropdownlist size="10" ...>
Does this work? (I am guessing it,as dropdownlist is SELECT tag in html)

Resources