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

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

3 Column Listview output - is it possible

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
hi all, i am looking to create a 3 column listview output that looks like this.  Basically its an alphabetic list of one field but it needs to output like newspaper columns.  Is it possible to do this with simply css?  Or will i have to programmaticaly break up the dataset into 3 and actually make 3 listviews?     aaaaaaabaaacaaadaaaeaaaf   aaagaaahaaaiaaajaaalaaam aaanaaaoaaapaaaqaaar

View Complete Post

More Related Resource Links

listView Sort for a celltmplate column

hi , i have a list view with a column that is binded to a field in my database the field contains integers that represents the City_ID , and i a have another table that contains the cities and their ID's, so , when i apply the sort based on this column (City Column) the list View is sorted based on the integers not on the city names here is my XAML definition of that column : GridViewColumn Header="City_Name_ID" Width="75">                         <GridViewColumn.CellTemplate>                             <DataTemplate>                                 <ComboBox IsSynchronizedWithCurrentItem="False" ItemsSource="{Binding Source={StaticResource CitysViewSource}}" SelectedValue="{Binding Path=City_Name_ID}" SelectedValuePath="City_ID" DisplayMemberPath="City_Name"/>                      &nb

Lookup column output includes strange characters.

Hi all, I have a lookup column ("Priority"), that returns a number, which it looks-up from a different list (obviously). I have a workflow that emails the user when the list item is created, and in that email I have included the Priority field. However, the email is showing the contents of the Priority field along wth other characters - an example is: The column in the list says 3 The column in the email says 3;#3 What's going on? Why is it adding the additional characters to it? I'm not sure where it's coming from? This only seems to happen where a lookup column contains a number. Thanks in advance. Duncan

ListView fixed size column headers

Hi, I am using a ListView in its 'Detail' view. I have added several columns there and I want to restrict resizing the column width. I couldn't find a ways to do that; is there any easy way to do that? ThanksCJ

Listview column issue??

Hello.      i have a listview with around 9 column and in that i have column as Address.Now everything works fine....Now suppose lots of character in Address then my css breaks...Is it possible to display few characters of the address followed by .....  ??? i have seen in few site but no clue how to implement...like instead of          Abhishek,House No.30,Middle Lane,Arizon.i want just        Abhishek,House No.30,Middle ......and i would like to implemet mouse hover extender later to display full address but i am not able to implement first part only...Can any one guide me on this??? and i have used this link for my css. http://mattberseth.com/blog/2008/05/modifying_data_with_the_listvi.htmlThanks.

Remove column from Listview


I'm binding a listview control to LinqDataSource and can't find a way to remove unnecessary columns.

Ellipsis and Black color on ListView column




I have a very awesome ListView. Now I want to make it look as awesome as it is. But I don't know how to do it. I have tried to do it with Styles and Templates but I just can't get the hang of it.


Here's what I have:

I have a ListView with a number of columns. Each column corresponds to a Property of MyClass. I have a number of instances of MyClass tossed inside a CollectionView which is set as the source of this awesome ListView. The columns are created during runtime in C# code. So the bindings are done there. There are no column in the XAML part (it's just an empty listview there).


What I want to do:

I want to first of all add CharacterEllipsis on all columns. So that if a columns is too narrow the text inside it will go "Somet..." instead of just cutting it off to Somet (with half a t).


The next thing is that when a column is sorted I want to change color on that specific column, to black. I have managed to use a DataTemplate to style a specific column but the problem here is that I don't know how to do the binding. :(


A small note: each column is created during runtime in C# code (note: not in xaml). I have a loop which creates each column, binds it to the correct corresponding property, and adds it to the ListView.


How to expand the listview column header automatically when text grows?


I have a column goes like this:

 <ListView Name="Col1" Margin="5,0" 
     ItemsSource="{Binding Col1}" 
     SelectedValue="{Binding Col1Item, Mode=TwoWay}"
     Width="100" HorizontalAlignment="Left">
        <GridViewColumn Header="{Binding Col1Header}" DisplayMemberBinding="{Binding Name}" />

data of all the items are bound from viewmodel.cs during runtime. i got a problem where the width of header is not adjusted automatically when i got a longer text for it.

what have i missed? please help.


1 + 1 = 3

using a stored procedure for a listview, I am trying to only return items in a column of a table tha


I am trying to create a stored procedure that when fed a session parameter, it will only find items that  start with a particular character.  For example, if I have a table named table1, and a column name col1, then if I have 10 items in the column and 5 of them start with the letter c, I want to use a stored procedure to onlly return the items that start with a c.

I am sure it is somethin like:


FROM table1 

WHERE col1 = "c??????????"

How to detect listview column header clicked from my viewmodel.cs?


i want to sort the listview items when the header of the column is clicked. how do i detect the header click event from my viewmodel class.

i don't want to do this in my xaml code behind.



1 + 1 = 3

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

Prior to ASP.NET 3.5, developers who needed to display a set of records could choose between the GridView, DataList, and Repeater controls. The GridView provides rich data features, but has a very boxy layout; the DataList and Repeater allow for a more flexible layout, but lack the "point and click" data features found in the GridView, DetailsView, and FormView controls. The ListView bridges the gap between layout flexibility and built-in data features.

This article, the first in a series of articles on the ListView and DataPager controls, looks at the ListView's many available templates and illustrates how to display data. Read on to learn more!

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

WPF Tutorial - Using The ListView, Part 1

Many of the controls in WPF have a downright dizzying array of capabilities and features, due in large part to the composibility of all the components. The ListView control is a great example of this - the possibilities are almost endless. This series of tutorials on the ListView will hopefully make the space of possible options seem not quite as daunting

Comma-Delimited Output

One of the common tasks performed when retrieving data from a SQL Server database is returning the result as a comma-delimited output instead of a result set. This task can be performed by using a CURSOR selecting the column to be concatenated together. Each row returned by the CURSOR is then concatenated together into a variable separating each one by a comma.

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


Alternating row background for first column of a report


is there a way to make the first column of a report use the an alternating background color? 

I have the background color set for the entire row however it does not work for the first column if the color is set to an expression.  If I just set it to a color i.e. red it works just fine. If I insert a dummy column to the left it works just fine (but the dummy column does not work, presumably because it is first??).

In the file below only the textbox for part number does not show an alternating background.  All others work correctly.

                    <Textbox Name="PartNumber">

How to listen to events within a listview



I've got a listview and I've put a button control in one of the columns, I'm trying to figure out how I have listen to the button click within a certain row, but can't see the button in the dropdown for the IDs I can generate events for.

I'd like to get the primary key of the row that's been clicked on and then run a sql statement against it.

Any help would be appreciated.

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