.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Applying Pageing and Sorting on ListBox Control

Posted By: Asim Sajjad     Posted Date: September 17, 2011    Points: 2   Category :Silverlight
If you have ever used the data grid control then you are familiar with the sorting functionality which is provided by default, when you click any of the data grid header then it will sort the records according to the that column name on every click it will sort it ascending or descending direction. Similarly you are familiar with the data pager control which we often used with the data grid control to show record in the form of page which contain specific page size.It was one of the question which one of my colleague ask me "Can we apply paging to the List Box control ". As I didn't use data pager control other then data grid so in this post I have used the data page control and also the sorting which is provided by the PagedCollectionView.

View Complete Post

More Related Resource Links

Sorting Data in a GridView Web Server Control

The GridView control provides built-in sorting functionality without requiring any coding. You can further customize the sort functionality of the GridView control by using custom SortExpression property values for columns as well as by using the Sorting and Sorted events

Manually sorting and paging Gridview without using datasource control

Many a times while working with Gridview we want to work with the paging and sorting functionality without using any datasource control. Gridview is flexible enough to perform these tasks without the use of any datasource control and only a few lines of code.

Persist data in a dynamically populated ListBox in a user control


Hi All,

I am trying to persist data in a dynamically populated ListBox in a user control. Here are the details

I have a user control which contains a a listBox and button. On Page_Load of user control I am populating the ListBox control with some values. On Click of button, I am trying to fetch the values which I have selected in ListBox. Though this seems very simple and straight forward I am unable to fetch values.

My Page_Load Function

void Page_Load(object sender, EventArgs e)










My Click Function

Protected Void Button1_Click(object sender, EventArgs e)


       string strValue = listBox.SelectedValue



I have placed brake point at Page_Load and on click function, I am seeing that the moment the breakpoin

Applying custom CSS to the MOSS 2007 Calendar control Month view



I have a requirement to use the MOSS 2007 Calendar Control - month view is to apply a custom css to have a look and feel as per our requirements.

We tried applying the custom css to the MOSS 2007 calendar control - month view, it does take the custom css and applies it, but when i click on any date and come back to the calendar control, it changes the CSS of the MOSS calendar control back to the default one.

Let me know if anyone has any suggestion on  how to customize the calendar control for css for our intranet application.

Your response would be highly appreciated.






Sorting a ListBox or ComboBox on a Converted Value

Is it possible to apply a Converter to the SortDescription of a CollectionViewSource?  My ViewModel contains a List<> of a class that contains an enum and a Boolean.  My XAML displays a multi-select ListBox, showing the localized names of the enum values using a Converter in the View, and binds each ListBoxItem's IsSelected to the Boolean in the members of the bound List<>.  That's working.  Now I want to sort the ListBox items by those localized enum names, without reordering the List<> in the ViewModel.  Is this possible, and if so, how can it be done?

Listbox control display property


Iam using vb.net 2.0. I have implimented  Autocomplete textbox using  textbox and listbox.These are part of grid view controls. 

If i enter data in 1st row textbox the suggestions listbox  box it is coming in between the 1 st and 2nd row of grid.So alignment is getting disturbed. How can i display the suggestions list box over the second row of grid.

I have tried chaging the display property of listbox..but no change in display..i think some other property is obveriding this.


Please help me in this.

Thanks in Advance,


How to create a server control with a listbox and dynamic control using asp.net server control in C#


Hello friends,

I need to create a reusable custom control,which is like a form containing a listbox and some fields.The fields can be either textbox or  combobox as needed for different applications,which can be selected on the property of the form onwhich page that i am using it,also i needed to specify the number of fields in that property.And also need place 3 buttons below for edit and delete the selected item in the listbox and a button to save.Data will be binded from the database as needed for different applications. Please tell me with code how to create it using asp.net server control in C#.

Thanks in advance,


A composite control with a listbox


hello friends,

I need to create a composite control with a listbox.The selected item should be displayed on a textbox and need to edit and delete that selected item by clicking on 2 buttons edit and delete.Also another button to add item to the listbox.Items will be binded from the database as reqiured for the application.

How will create this composite control using asp.net server control?please tell me the code in C#. 

refresh listbox on updatepanel ajax control tool kit


Hi all, 

i have a dropdownlist and a listbox inside an update panel. I populate the listbox with a selected value of the dropdownlist and works ok. The problem is when delete an item from the listbox because does not the refresh of the listview and still to watch me the deleted item. 

how can i do the refresh?

pd: i am using framework 2.0

thx in advance!

How To : Add a ListBox Win form control to a asp.net .aspx page


Here is my requirement:

Do File upload without fileupload asp.net control, instead do following:

1) 'drag and drop' of file (attachment) from windows explorer to .aspx page

2) 'Copy / Paste'  - in a .aspx

What I can think of is doing it by creating a 'Windows ListBox control'.dll and calling it in aspx page with


Is there any better solution out there?

Extending a ListBox Control - How to make the extended type require the listbox items implement a ch


I am working on a drag and droppable timeline control, and I am making decent progress.  What I have so far will work decently enough with MVVM design patterns, but I am inexperienced with this kind of advanced control extending so I am sure that some of my methods are crude at best.

I have an extended content presenter control that I want to ensure is what is actually used inside my specialized listbox.  Right now I do the following:

<DataTemplate x:Key="TempTemplate" DataType="{x:Type local:TempDataType}">

			<tt:TimeLineItemControl StartTime="{Binding Path=StartTime}

"Unable to Load Client Print Control" after applying CU8 to 2008 SP1


In our environment, users are unable to Install ActiveX controls themselves. Primarily, this is particularly true in our Citrix environment. Upon applying CU8 to our 2008 SP1 SQL Server that we use to run reports, I'm no longer able to manually register the rsclientprint.dll to register the rll's and ActiveX control for users. Is this a known issue? Is there a new method to acheiving this same task?

Due to the size of our citrix environment, manually installing the activeX control through internet explorer on every one of our Citrix servers is NOT an option.

Any assistance is GREATLY appreciated.

Find control TextBlock inside Listbox.ItemTemplate

Hello, I'm a big question, I have a XAML code, where it i
insert a TextBlock to the name "tbNomeHotel" but I can not
call it in C # code, for example: string = xxx tbNomeHotel.Text;

this only happens when the TextBlock is between the tags, and <ListBox.ItemTemplate> <DataTemplate>, which make the data come directly from the database and are displayed in a list.

below is the XAML code, where the bank's value is displayed in a ListBox, if the name of a hotel either!

I like to refer to the TextBlock component in my C # code, so I can use it as a parameter for other queries??

eg>> string xxx = tbNomeHotel.Text;



Name = <StackPanel "stkPanel" Orientation="Horizontal" Width="419">


Listbox control with Ajax


Hi all,

As a newbie in Ajax. So I ask somebody for help.

I have 2 listboxes (properties: selected mode = multiple, autopostback = true) and 2 buttons. The items of both Listboxes come from database.

The item(s) of the 2nd listbox are some of the items of the 1st listbox.

What I want is: I can 'move' the item(s) between 2 Listboxes by clicking the buttons.

My code workt goed, but als we know, the screen do a flicking. I know that we can avoid the flicking with Ajax. But I don't know how?

I have googled, but find no answer in detail which can guide me.

Here is the process:

When page_load, the 2 buttons are not enabled (enabled = false) and the item(s) of the 2 listboxes are populated from database. When 1 of the items in the 1st listbox is selected, the 'right arrow' button is set to enabled = true. When this button is clicked, the selected item(s) will move to 2nd listbox. The selected item(s) in 1st listbox will be set to enabled = false and the 'right arrow' button set to enabled = false.

When 1 of the items in the 2nd listbox is selected, the 'left arrow' button is set to enabled = true. When this button is clicked, the selected item(s) will be remove from 2nd listbox and will appear in 1st listbox by setting to enabled = true and the 'left arrow' button set to enabled = false.

How to implement paging and sorting in asp.net Gridview control?

In this article, I will explore how to implement paging and sorting in gridview control without using sql and object data sources.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend