TableStyle and empty DataView ?

Jarod

Regular
Joined
Feb 5, 2003
Messages
82
Location
Bruxelles
Hello

Here is my problem.
I'm using a DataTable.DefaulView as a DataSource of my DataGrid.
And I also set a TableStyle (before setting the datasource) to be able to format the columns.

Everything is working fine except in one case:
if my DataTable is empty (no rows).
In that case, when I do:
DataGrid1.DataSource = myDataTable.defaultView
my program crashes. (no error, but take infinites time).

If I do the same without applying my TableStyle, it works fine, as if I add an empty row to my DataTable.

However, I would like to be able to apply my TableStyle and having no rows in my Table.
Is that possible ?
Thanks,
 
Ok, my mistake...
After another test, this is working find with a normal dataGrid. My problem was due to the fact I was using my own custom dataGrid which had a "boundary effect" when no data was displayed. :D
Corrected now...
 
Back
Top