DataGrid & DataView questions

  • Thread starter Stan Sainte-Rose
  • Start date
S

Stan Sainte-Rose

Hello,
I need to know how to format Integer and Real with the datagrid.
In fact, I want to use the right alignment.
When I use this option the header text comes with the right alignment too.
:(

Another question with datagrid, is there a way to have "blank lines".
I mean I would like to have (n) lines displayed even if they are empty (like
an excel page).
Just for the design.

And finally, what are the advantages to work with dataview controls instead
of working directly with datatable controls ?
Thks for you lights.

Stan
 
S

Slonocode

Stan said:
And finally, what are the advantages to work with dataview controls
instead of working directly with datatable controls ?
Thks for you lights.

Stan

A dataview will allow you to filter and sort. Every dataset has a "behind
the scenes" dataview called the default dataview.
So when you bind to a dataset you are really binding to the default
dataview.
Optionally you can create other dataview objects that sort or filter the
data and then bind to that.

HTH
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Stan,
I need to know how to format Integer and Real with the datagrid.

The DataGridTextBoxColumn class has the Format property. You can set this
property value to the desired format string. If you don't know how to use
this class, please refer to the "DataGridTableStyle Class" topic in the MSDN
Library.
In fact, I want to use the right alignment.
When I use this option the header text comes with the right alignment too.
:(

You cannot set different alignments for the header and the data. You will
have to implement your own column style to achieve that. This column style
would use the standard Align property value for the header (as you cannot
customize its appearance) and will introduce a new property DataAlign that
would govern the alignment of the data displayed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top