.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

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

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

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

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.

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?

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

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?

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

SSRS report export to CSV showing column headers always in English inspite of the selected locale.


We are encoutering an issue with SSRS report export to CSV showing column headers always in English, regardless of locale.


We are using SSRS to display report results in a report viewer window launched from an ASP.net page.


When the report viewer is lauched in fr-CA locale, the report viewer window content is in French. However, when the results are exported to CSV, all the column header labels inside the CSV are always in English.


Dynamic Column headers changes according group level


Hello all,

I have a report with few grouping levels. by default few of the group levels are visible, while for a detailed report either specific group need to be collapsed, or detailed report option to be chosen.

Since in the group summary line I have few statistics, I want the report column header/names to be changed dynamically. I have used expression in header so it will change dynamically when a user wish to see the detailed or summary report using:

=IIf(Parameters!P_Detailed_Report.Value="Y","Detailed column header ","Summary column Header")

But the above won't work off course when the user actively collapses a group.

Can I have the header text to change when a certain group is collapsed by user ? 




Show column headers when gridview returns empty data set




I have in my code a gridview that I redirect to excel, it works fine when I have data in the data set. waht I want is to show column headers when there is no data right now what i get is empty sheet. 

WPF Datagrid Scrolling Column Headers Without Data



I have a Datagrid with enough columns that some will need to be scrolled to to see them.  The problem I am having is if the filter returns no rows, the horizontal scroll bar is greyed out and you can't scroll over to see all the column name.  I'm hoping this is an easy solution, and i'm just missing something obvious as this is my first WPF application.

Thank you for your help in advance.


Adam - Please remember to mark the answers.

Implementing the Singleton Pattern in C#

The singleton pattern is one of the best-known patterns in software engineering. Essentially, a singleton is a class which only allows a single instance of itself to be created, and usually gives simple access to that instance. Most commonly, singletons don't allow any parameters to be specified when creating the instance - as otherwise a second request for an instance but with a different parameter could be problematic! (If the same instance should be accessed for all requests with the same parameter, the factory pattern is more appropriate.) This article deals only with the situation where no parameters are required. Typically a requirement of singletons is that they are created lazily - i.e. that the instance isn't created until it is first needed.

Keeping column headers repeating on each subsequent page


I have tried using the tablix properties functionality (keep column/row headers scrolling on each page) but it does not seem to work...in previews or when deployed on the web. Any suggestions?

Also, can text boxes be set to be kept floating/frozen on a page?


Singleton Design Pattern in C#, Vb.NET

Ensure a class has only one instance and provide a global point of access to it.

LINQ : Implementing IN and NOT IN

I got tried of typing

var result = from s in source
where items.Contains(s)
select s;and so I implemented the IN and NOT IN methods as extension methods:
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