Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / Windows Forms

DataGridView Custom Headers in VB.NET

Rate me:
Please Sign up or sign in to vote.
4.56/5 (16 votes)
9 Mar 2009CPOL3 min read 185.2K   8.7K   47  
How to give Custom Headers to your DataGridView
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Click here to find out more!</title></head><body leftmargin="0" topmargin="0" bgcolor="#ffffff" marginheight="0" marginwidth="0"><!-- Template Id = 2593 Template Name = Banner Creative (Flash) -  In Page -->
<!-- Copyright 2006 DoubleClick Inc., All rights reserved. --><script src="B3424356_data/flashwrite_1_2.js"></script>
<script language="JavaScript">
<!--
function DCFlash(id,pVM){
var swf = "http://m1.2mdn.net/1672981/crystal-160x600.swf";
var gif = "http://m1.2mdn.net/1672981/crystal-160x600.gif";
var minV = 6;
var FWH = ' width="160" height="600" ';
var url = escape("http://ad.doubleclick.net/click%3Bh=v8/37e7/3/0/%2a/j%3B211683331%3B0-0%3B0%3B33195010%3B2321-160/600%3B30164736/30182613/1%3B%3B%7Esscs%3D%3fhttp://www.businessobjects.com/jump/xi/crda/default.asp");
var wmode = "opaque";
var bg = "";
var dcallowscriptaccess = "never";

var openWindow = "false";
var winW = 600;
var winH = 400;
var winL = 0;
var winT = 0;

if(typeof(encodeURIComponent)=="function"){url=encodeURIComponent(unescape(url));}
var fv='"clickTag='+url+'&clickTAG='+url+'&clicktag='+url+'"';
var bgo=(bg=="")?"":'<param name="bgcolor" value="#'+bg+'">';
var bge=(bg=="")?"":' bgcolor="#'+bg+'"';
function FSWin(){if((openWindow=="false")&&(id=="DCF0"))alert('openWindow is wrong.');if((openWindow=="center")&&window.screen){winL=Math.floor((screen.availWidth-winW)/2);winT=Math.floor((screen.availHeight-winH)/2);}window.open(unescape(url),id,"width="+winW+",height="+winH+",top="+winT+",left="+winL+",status=no,toolbar=no,menubar=no,location=no");}this.FSWin = FSWin;
ua=navigator.userAgent;
if(minV<=pVM&&(openWindow=="false"||(ua.indexOf("Mac")<0&&ua.indexOf("Opera")<0))){
	var adcode='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="'+id+'"'+FWH+'>'+
		'<param name="movie" value="'+swf+'"><param name="flashvars" value='+fv+'><param name="quality" value="high"><param name="wmode" value="'+wmode+'"><param name="base" value="'+swf.substring(0,swf.lastIndexOf("/"))+'"><PARAM NAME="AllowScriptAccess" VALUE="'+dcallowscriptaccess+'">'+bgo+
		'<embed src="'+swf+'" flashvars='+fv+bge+FWH+' type="application/x-shockwave-flash" quality="high" swliveconnect="true" wmode="'+wmode+'" name="'+id+'" base="'+swf.substring(0,swf.lastIndexOf("/"))+'" AllowScriptAccess="'+dcallowscriptaccess+'"></embed></object>';
  if(('i'!="j")&&(typeof dclkFlashWrite!="undefined")){dclkFlashWrite(adcode);}else{document.write(adcode);}
}else{
	document.write('<a target="_blank" href="'+unescape(url)+'"><img src="'+gif+'"'+FWH+'border="0" alt="" galleryimg="no"></a>');
}}
var pVM=0;var DCid=(isNaN("211683331"))?"DCF0":"DCF211683331";
if(navigator.plugins && navigator.mimeTypes.length){
  var x=navigator.plugins["Shockwave Flash"];if(x && x.description){var pVF=x.description;var y=pVF.indexOf("Flash ")+6;pVM=pVF.substring(y,pVF.indexOf(".",y));}}
else if (window.ActiveXObject && window.execScript){
  window.execScript('on error resume next\npVM=2\ndo\npVM=pVM+1\nset swControl = CreateObject("ShockwaveFlash.ShockwaveFlash."&pVM)\nloop while Err = 0\nOn Error Resume Next\npVM=pVM-1\nSub '+DCid+'_FSCommand(ByVal command, ByVal args)\nCall '+DCid+'_DoFSCommand(command, args)\nEnd Sub\n',"VBScript");}
eval("function "+DCid+"_DoFSCommand(c,a){if(c=='openWindow')o"+DCid+".FSWin();}o"+DCid+"=new DCFlash('"+DCid+"',pVM);");
//-->
</script><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="DCF211683331" width="160" height="600"><param name="movie" value="http://m1.2mdn.net/1672981/crystal-160x600.swf"><param name="flashvars" value="clickTag=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp&amp;clickTAG=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp&amp;clicktag=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp"><param name="quality" value="high"><param name="wmode" value="opaque"><param name="base" value="http://m1.2mdn.net/1672981"><param name="AllowScriptAccess" value="never"><embed src="B3424356_data/crystal-160x600.swf" flashvars="clickTag=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp&amp;clickTAG=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp&amp;clicktag=http%3A%2F%2Fad.doubleclick.net%2Fclick%253Bh%3Dv8%2F37e7%2F3%2F0%2F%252a%2Fj%253B211683331%253B0-0%253B0%253B33195010%253B2321-160%2F600%253B30164736%2F30182613%2F1%253B%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.businessobjects.com%2Fjump%2Fxi%2Fcrda%2Fdefault.asp" type="application/x-shockwave-flash" quality="high" swliveconnect="true" wmode="opaque" name="DCF211683331" base="http://m1.2mdn.net/1672981" allowscriptaccess="never" width="160" height="600"></object>
<noscript><a target="_blank"
href="http://ad.doubleclick.net/click%3Bh=v8/37e7/3/0/%2a/j%3B211683331%3B0-0%3B0%3B33195010%3B2321-160/600%3B30164736/30182613/1%3B%3B%7Esscs%3D%3fhttp://www.businessobjects.com/jump/xi/crda/default.asp"><img
src="http://m1.2mdn.net/1672981/crystal-160x600.gif" width="160"
height="600" border="0" alt="" galleryimg="no"></a></noscript></body></html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions