.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

ListView fixed size column headers

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Windows Application
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

View Complete Post

More Related Resource Links

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.

Scrollable GridView with fixed headers in asp.net C# vb.net

In this example i am going to show how to create scrollable GridView with fixed headers which don''t get scrolled with records and stay on the top in asp.net using css, I''ve tested this code on IE7 and Firefox 2.0 , 3.5.

For this we need to add css to headers of gridview to keep them on the top.

First of all place a Panel on the aspx page from thetoolbox. Set height to 200px and width to 200px
and scrollbars to Vertical.
Now add a gridview inside this Panel and set the datasource to populate gridview.

C++ Q&A: Locking Column Headers, Implementing Singleton Classes


Prevent the sizing of the column headers in an ATL composite control. Also, see how you can share a small amount of simple data among multiple processes running on the same machine without Remoting.

Paul DiLascia

MSDN Magazine June 2003

Owner-drawn ListView and nonstandard subitem size: selection problems.

Hello, I have a ListView whose first column is owner-drawn and items can be selected (I had to jump through hoops to draw the focus rectangle correctly). The problem is, my custom drawing displays the text in a wider font than normal, and only for this column. And when I click an item to select it, the right part of the text does not react, because the listview doesn't "know" there is text there (since it "thinks" the text is smaller). How can I correct this? Is there a "hit test" or "measure item" event or something, to tell the list view to consider a wider zone for clicks?

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

can do rowspan+columnspan in DataGrid Column Headers?

i wanna do something like this: 4 column headers: Header Font, Header Size, Cell Font, Cell Size you can see they are 2 grps, with a pair of each. now i wanna create the column headers like:     Header  |     Cell Font | Size  | Font | Size is it possible? and how to do that?

3 Column Listview output - is it possible

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

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.

How to copy column headers along with the query result in SS00

HiIs it possible to copy the column headers along with the query result from SQL Server 2000 Query Analyser.Thanks in advance.fjz

Hiding column headers in grouped dataformwebpart

Hi, I've set up a dataformwebpart (from a SQL view) that shows a list of orders grouped by salesperson, I've succesfully created a formula that sums the total value of the orders in the group header but when I open the page the column names within the group that is collapsed are still visible. If I expand then collapse the group manually it hides the group column names as I wanted but when the page refreshes it shows the column names again! All I wanted to achieve is to have a headline figure, that is all, that is then expandable to show column names and the data, having the column names underneath the headline figure makes it look very messy.   Does anyone know why this is happening and have any suggestions? Any help greatly appreciated. Thanks

Multiple column headers in Gridview

Hi,  I've been trying for the past few hours to add mutliple headers to my grid view but keep failing to get it to show.  There's plenty of examples online that I found but can't seem to get the most simplest to work.  Below is the code I've been using with no success.  I even tried changing the "TableCell" to "TableHeaderCell" but still yields no headers as expected.  Anyone know what I could be doing wrong? protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { GridViewRow headerow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert); TableCell headercell = new TableCell(); headercell.ColumnSpan = 3; headercell.Text = "My Custom Header"; headerow.Cells.Add(headercell); GridView1.Controls[0].Controls.AddAt(0, headerow); } }

Can I customize column headers with autogeneratefields = true?


If my SQL column is UnitPrice, that's how it shows up in my templates. ok fine.

Now is there a way to customize the column header so it says "Unit Price" without changing AutoGenerateColumns to false & recreating the header & columns myself?

And if not, how can I modify the Edit.aspx fields? It was no problem with the gridview, but form view seems a little different.


Thanks for the help!!

How do I remove column headers in list view webpart?

I'd like to remove the column headers from a list view web part, as well as from a document library web part. How can I accomplish this in SharePoint 2010?

SSRS 2008 - Fixed headers while scrolling - works fine for Matrix - but not for Table??!!


I have this feature working fine for matrix, but it does not work as expected for Table (Tablix).

I tried all over, and setting both check boxes in the 'Tablix Properties' dialog page 'Repeat header rows on each page' and 'Header should remain visible while scrolling' for both row header and column header, but none of it is working. Am I missing something?

In the properties table (F4) for text box of tablix, under 'Other' there is 'RepeatWith' - none / tablix: what is this used for? I tried this property also but I cannot get the headers fixed / visible while scrolling. I cannot get the 'column headers' repeat on each page of the report. Very frustrating...

Does anyone face similar issue? Can anyone help please? Do I need any update / download any fix? For now I have the following version installed for Visual Studio 2k8:
Microsoft SQL Server Reporting Services Designers Version 10.0.1600.22


Can I hide the "Picture size" column in a picture library?


I created a picture library. The picture size, preview, and File type columns are of computed types. Is it possible to hide them?

Thanks, Ninel

Can I hide the "Picture size" column in a picture library?


I created a picture library. The picture size, preview, and File type columns are of computed types. Is it possible to hide them?

Thanks, Ninel

coalesce building pivot column headers - making them descending instead of ascending


Hi, I was somewhat surprised and happy to see that the t-sql statement below can be used to dynamically build my pivot column headers.   I was also surprised to see that either it is smart enought to build the headers alphabetically or I'm incredibly lucky.  Date is a char(7) column in my table with format yyyy/mm.

Anyway, it would be really cool for me if the headers were build descending instead of ascending.  I tried using a view to do this but the thing has a mind of its own.  I'll start writing a function but would like to know if the community knows of a better way. 

It generates a string that looks something like ...




@PivotColumnHeaders VARCHAR

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