RowDataBound and RowType

by ebarcza 11/19/2008 12:56:00 PM
if (e.Row.RowType == DataControlRowType.Header)

{

e.Row.Cells[8].Text =
"OV<br>RD";

e.Row.Cells[10].Text = "Each";e.Row.Cells[11].Text =

"Total";

}

//TODO Comment these indexes

if(e.Row.RowType == DataControlRowType.DataRow)

{

 //Do Code

}

Tags:

Create an In-Memory data Table in C#

by ebarcza 11/13/2008 11:01:00 AM
Private Function CreateDataTable() As DataTable Dim dtNewItems As New DataTabledtNewItems.Columns.Add( "ItemID", System.Type.GetType("System.Int32"))

dtNewItems.Columns.Add("UnitID", Type.GetType("System.Int32"))

dtNewItems.Columns.Add(
"CategoryID", Type.GetType("System.Int32"))

dtNewItems.Columns.Add("ProductCode", Type.GetType("System.String")) 'unit of measure

dtNewItems.Columns.Add("Item", Type.GetType("System.String"))

dtNewItems.Columns.Add("UnitPrice", Type.GetType("System.String"))

dtNewItems.Columns.Add(
"Date", Type.GetType("System.String"))

dtNewItems.Columns.Add("Quantity", Type.GetType("System.String"))

dtNewItems.Columns.Add(
"ExtendedPrice", Type.GetType("System.String"))dtNewItems.Columns.Add("ItemType", Type.GetType("System.String"))

 

Return dtNewItems

End Function

 

 

Add Records to it

 

Dim rwNew As DataRow

rwNew = NewRecs.NewRow

rwNew(
"Item") = itemName
rwNew("ItemType") = itemTypeCoderwNew( "ProductCode") = unitOfMeasure

rwNew("UnitPrice") = unitPricerwNew( "Quantity") = qty

rwNew("ExtendedPrice") = (CDbl(qty) * CDbl(unitPrice)).ToString()

NewRecs.Rows.Add(rwNew)

Tags:

Automatically printing the contents of an Iframe

by ebarcza 11/7/2008 10:49:00 AM

When you want to automatically print the contents of an Iframe, such as greybox, you'd think you could just do a window.print in body Onload...not so much. Doing this just prints the contents of the parent window. The following javascript will do the trick however from within the Iframe

 parent.frames.item(0).window.print();

That's all there is to it!

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in