i defined a dataset and set it instance as the data source of the data grid
but i cannot find the mapping name of the table of this dataset inside the
tablestyle property, i dont know how to set the style

Re: can not set the tablestyles to a data grid by Norman

Norman
Thu Nov 27 11:16:10 CST 2003

The simplest way, of course, is set DataGrid's TableStyle in Properties
window: click "TableStyles" property to add as many TableStyles as you want.
That means a sigle DataGrid can be bound to different datasource (Tables)
without extra configuration other than TableStyle. In each TableStyle, then,
you define GridColumnStyle for each column of the DataGrid, mapped to a
column in DataTable. You can also configure TableStyles/GridColumnStyles in
code programmingly.

Say, if your DataSet has to tables: "Table1" and "Table2". You can add two
TableStyles, mapping to "Table1" and "Table2" respectively. So, if in your
code, you do

DataGrid1.DataSource=MyDataSet
DataGrid1.DataMember="Table1"

The DataGrid will show the look as the TableStyle, mapped to "Table1",
defined. And later you may want to display data in "Table2", you simply do:

DataGrid1.DataSource=MyDataSet
DataGrid1.DataMember="Table2"

The DataGrid's look will change according to the definition of the other
TableStyle.

"Cyrus" <CyrusChiu@kfsolution.com> wrote in message
news:%23BbvLhJtDHA.1224@TK2MSFTNGP09.phx.gbl...
> i defined a dataset and set it instance as the data source of the data
grid
> but i cannot find the mapping name of the table of this dataset inside the
> tablestyle property, i dont know how to set the style
>
>



Re: can not set the tablestyles to a data grid by Cyrus

Cyrus
Thu Nov 27 20:39:41 CST 2003

I know the way to do it in design time
but my problem is I can't find the dataset's table name in the TableStyles
property's mapping name

"Norman Yuan" <normanyuan@RemoveThis.shaw.ca> wrote in message
news:ujqxb.509224$9l5.439295@pd7tw2no...
> The simplest way, of course, is set DataGrid's TableStyle in Properties
> window: click "TableStyles" property to add as many TableStyles as you
want.
> That means a sigle DataGrid can be bound to different datasource (Tables)
> without extra configuration other than TableStyle. In each TableStyle,
then,
> you define GridColumnStyle for each column of the DataGrid, mapped to a
> column in DataTable. You can also configure TableStyles/GridColumnStyles
in
> code programmingly.
>
> Say, if your DataSet has to tables: "Table1" and "Table2". You can add two
> TableStyles, mapping to "Table1" and "Table2" respectively. So, if in your
> code, you do
>
> DataGrid1.DataSource=MyDataSet
> DataGrid1.DataMember="Table1"
>
> The DataGrid will show the look as the TableStyle, mapped to "Table1",
> defined. And later you may want to display data in "Table2", you simply
do:
>
> DataGrid1.DataSource=MyDataSet
> DataGrid1.DataMember="Table2"
>
> The DataGrid's look will change according to the definition of the other
> TableStyle.
>
> "Cyrus" <CyrusChiu@kfsolution.com> wrote in message
> news:%23BbvLhJtDHA.1224@TK2MSFTNGP09.phx.gbl...
> > i defined a dataset and set it instance as the data source of the data
> grid
> > but i cannot find the mapping name of the table of this dataset inside
the
> > tablestyle property, i dont know how to set the style
> >
> >
>
>



Re: can not set the tablestyles to a data grid by David

David
Fri Nov 28 22:07:05 CST 2003

In article <OebhpshtDHA.1884@TK2MSFTNGP10.phx.gbl>, Cyrus wrote:
> I know the way to do it in design time but my problem is I can't find
> the dataset's table name in the TableStyles property's mapping name

If you don't know the table name, then how did you set the Data Member
of the grid? MappingName (assuming we're using datatables) is the same
name you gave when you set DataMember.

I'm tempted here to suggest "MyDataSet.Tables[0].TableName", which
might work for you, but I'm not sure I completely understand
the problem.



--
David
dfoster at
hotpop dot com

Re: can not set the tablestyles to a data grid by Cyrus

Cyrus
Mon Dec 01 00:01:43 CST 2003

of coz i know the table name
what i said is that i cant find out the table name in the designer's
MappingName's drop down box
but i type it by myself and it's ok now


"David" <dfoster@127.0.0.1> wrote in message
news:slrnbsg6rd.j4j.dfoster@woofix.local.dom...
> In article <OebhpshtDHA.1884@TK2MSFTNGP10.phx.gbl>, Cyrus wrote:
> > I know the way to do it in design time but my problem is I can't find
> > the dataset's table name in the TableStyles property's mapping name
>
> If you don't know the table name, then how did you set the Data Member
> of the grid? MappingName (assuming we're using datatables) is the same
> name you gave when you set DataMember.
>
> I'm tempted here to suggest "MyDataSet.Tables[0].TableName", which
> might work for you, but I'm not sure I completely understand
> the problem.
>
>
>
> --
> David
> dfoster at
> hotpop dot com