Monday, September 7, 2009

Put HTML page break for printing

you can use any of the following style for HTML page break (specially for printing)
1) style="page-break-after:always"
2) style="page-break-before:always"

Friday, September 4, 2009

Single border around HTML Table cell

style="border-collapse:collapse"

Borders for the cells are generally displayed independently from each other. so each cell has its own border and that's what border looks like double for the whole table. we can collapsed this double border into single border with the border-collapse style property, check the above example.

Select Distinct Column Values From DataTable

DataView dv= new DataView(SourceTable);
DataTable dt = dv.ToTable(true, "Col1", "Col2","Col3" ...);

Wednesday, September 2, 2009

get mouse position in c#

I might be wrong but you can try following two

Point p = Cursor.Position;
Point p2 = Control.MousePosition;