Check out following article:
http://www.microsoft.com/belux/nl/ms.../datagrid.mspx
Extending the DataGrid using CodeDom
The System.Windows.Forms DataGrid has several limitations, but is very
extensible. This article shows how to create a custom DataGridColumnStyle
that evaluates expressions for each row, stored in a string value, at
run-time. This can be useful if the DataGrid shows rows that have properties
that are objects themselves, or to add calculated fields. To obtain this
behavior, an ExpressionEngine is built which can compile and execute code at
run-time. To ensure ease-of-use and provide full design-time support for the
custom DataGridColumnStyle, a custom DataGrid, based on the standard
DataGrid is built too.
--
Greetz,
Jan
__________________________________
Read my weblog:
http://weblogs.asp.net/jan
"Irakli Lomidze" <Ir************@access.sanet.ge> schreef in bericht
news:e4**************@TK2MSFTNGP11.phx.gbl...
Dear Sirs.
I Have Question About Calculed Fields.
i have 5 Fields From Database Query And Want add 6-th Field6 that is
Calcued Based on that 5 fields. but it calculation reque call function
(method).
how i can do it ?
in MSDN
System.Type myDataType;
myDataType = System.Type.GetType("System.Decimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Total", myDataType, strExpr,
MappingType.Attribute);
myColumn.AutoIncrement = false;
myColumn.ReadOnly = true;
DataSet1.Tables["OrderDetails"].Columns.Add(myColumn);
But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Total", myDataType,
__CallCaluledFiledFunction(Price , Quantity) , MappingType.Attribute);
is it posible ?
Thank you in Advance