Dmitriy
Thu Sep 11 01:30:53 CDT 2003
Hi John,
This is achieved through usage of the DataGridTableStyle and
DataGridColumnStyle classes. You should create a DataGridTableStyle with
MappingName equal to "MyTable" and tune up table-wide properties like
background color if you need it. Then, add instances of
DataGridTextBoxColumn (or DataGridBoolColumn if you need such type of
column) for the data columns you want to display in order you want them to
display. MappingName property of each of the grid columns should correspond
to the name of the data column in the data table.
More information and examples on this can be found in MSDN Library.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"John" <john@nospam.infovis.co.uk> wrote in message
news:erf55r%23dDHA.2756@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I am binding my datagrid like this;
>
> MyDataGrid.SetDataBinding(ds, "MyTable") ' ds is the dataset
>
> The problem is this bring all fields from the table. How can I restrict
some
> of the columns from appearing? Also how can I change the order and widths
of
> the grid columns?
>
> Thanks
>
> Regards
>
>