Hello everybody
I have a WinGrid which DataSource is made from a Linq Query. Everything works fine. Now, when I try to Format a Column like
e.Layout.Bands[0].Columns[
"ColumnName"].Format = "{0:##,##0.00}";
the Format ist not accepted. Following things I already tried:
It doesn't matter what I try, the Format is not accepted.
I am working with Infragistics Winforms 9.1
Thanks for help
DataTable exposes a Columns collection and a Rows collection. You add members to the Columns collection to define the horizontal aspect of the table, and then add members to the Rows collection , with each cell's value corresponding to the column under which it appears. These collections expose the standard collection methods such as Add, Remove, and Clear...I'm sure there are several examples on MSDN which demonstrate how to manually populate a data table.
On the basis of my small Example I posted last time, could you give me a coding sample, how to loop through the variable 'Query' to build up the DataTable
Thanks a lot
As I suspected, the data type of the column is string. The IEnumerable<T>.ToDataSet method is responsible for this; there might be some way to make it generate columns of a certain type, but I don't know how myself. I would just build the DataTable manually, i.e., add the columns and rows yourself.
I have attached a small sample (unzip in c:\Temp) with two examples in it. Example one works with two datasets and with linq. Example two bindes a simpla Dataset to the DataSource of the grid. Here you can see, that only Example two works properly. Example one behaves like described above. I also tried around with different formating strings, but it doesn't help.
Hope you can help me.
PS: I only have the possibility to work with linq, because I have two different datasources (SQL-Server, Oracle)
I'm not sure if the format you are trying to uses here is valid for a Long. In particular the curly braces might be causing a problem.I don't think you need those.
Standard Numeric Format Strings
Custom Numeric Format Strings