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 DataGridColumnS tyle
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 ExpressionEngin e 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 DataGridColumnS tyle, 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.g e> schreef in bericht
news:e4******** ******@TK2MSFTN GP11.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.Get Type("System.De cimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Tot al", myDataType, strExpr,
MappingType.Att ribute);
myColumn.AutoIn crement = false;
myColumn.ReadOn ly = true;
DataSet1.Tables["OrderDetai ls"].Columns.Add(my Column);
But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Tot al", myDataType,
__CallCaluledFi ledFunction(Pri ce , Quantity) , MappingType.Att ribute);
is it posible ?
Thank you in Advance