I translate some flag-fields in corresponding messages, or have different time-formatting methods (short date, long date,...) depending on the aggregation level.
so i just send all my datatable to a kind of "generic" method that formats the fields, so no aspx file is required.
Hmmm..
You can set the formatting of the columns from the code behind as well
So instead of sending the datatable to a generic function to be formatted can you call a generic function that sets the formatting of the columns based on your aggregation level?
Suresh
----- Anna Schmidt wrote: ----
thank you
I'll try it now
since i have so many different datagrids, i create and format datagrids (o
the fly) without any formatting in the aspx.file.
for example I translate some flag-fields in corresponding messages, or hav
different time-formatting methods (short date, long date,...) depending o
the aggregation level.
so i just send all my datatable to a kind of "generic" method that format
the fields, so no aspx file is required.
do you have any better idea
thank yo
ann
Suresh said:
May be not the most efficient way.
dataview to insert the sorted records into the new DataTable (see sampl
below)you should consider formatting the data in your aspx page and not at th
datasource/datatable level
(i.e. In C#
DataView newDV = myDataTable.DefaultView newDV.Sort = "FirstName ASC"
DataTable tbNew = myDataTable.Clone() tbNew.Clear()
for (int i=0; i< newDV.Table.Rows.Count; i++
DataRow tbRow = tbNew.NewRow()
tbRow.BeginEdit()
DataRow dr = newDV
.Row
foreach(DataColumn dc in tbNew.Columns
tbRow[dc.ColumnName] = dr[dc.ColumnName].ToString().Trim()
tbRow.EndEdit() tbNew.Rows.Add(tbRow)
tbNew.AcceptChanges()
Suresh
----- Anna Schmidt wrote: ----
Hello
I have a datatable, that it sorted in a dataview, works fine
but i want to pass that sorted datatable to another methods (fo formatting
It doesn't work with dataview.table (only the original datatable i passed
DataTable dt = GetDT()
DataView dv = new DataView(dt)
dv.Sort = sortExpression
formatDataTable(dv.Table); // no sortin