Datagrid tablestyle mapping name

K

Kev Westwood

Hi

I'm using VS 2005 with CF2.

The datasource of my datagrid is a List(of MyObject). All the properties of
MyObject are visible as columns in the grid but i do not want all them to be
visisble so I want to create a table style to do this. However, what should
I use for the MappingName of the table style?

Thanks
Kevin
 
D

drozd

Hi

I'm using VS 2005 with CF2.

The datasource of my datagrid is a List(of MyObject). All the properties of
MyObject are visible as columns in the grid but i do not want all them tobe
visisble so I want to create a table style to do this.  However, what should
I use for the MappingName of the table style?

Thanks
Kevin

Try MyObject.

Kind regards,
Micha³
 
K

Kev Westwood

Hi Michal

I have tried that but to no avail.

I have a variable called MyList which is the datasource of the grid and is
declared like this :

Dim MyList as New List(of MyObject)

I have also tried this variable name as the mapping.

If i do a GetType on MyList it returns "List`1". I have also tried this as
the mapping name.

I have also tried using a bindingsource and have same problem if i use the
name or type of the binding source

So heres the list of mapping names i have tried so far:

MyObject
MyObject[]
MyList
List`1
Bindingsource
MyBindingSource

Any other ideas? Are tablestyles the only way to make a column invisible in
a datagrid in the compact framework?

Thanks
Kevin



Hi

I'm using VS 2005 with CF2.

The datasource of my datagrid is a List(of MyObject). All the properties
of
MyObject are visible as columns in the grid but i do not want all them to
be
visisble so I want to create a table style to do this. However, what
should
I use for the MappingName of the table style?

Thanks
Kevin

Try MyObject.

Kind regards,
Micha³
 
D

drozd

Hi Michal

I have tried that but to no avail.

I have a variable called MyList which is the datasource of the grid and is
declared like this :

Dim MyList as New List(of MyObject)

I have also tried this variable name as the mapping.

If i do a GetType on MyList it returns  "List`1".  I have also tried this as
the mapping name.

I have also tried using a bindingsource and have same problem if i use the
name or type of the binding source

So heres the list of mapping names i have tried so far:

MyObject
MyObject[]
MyList
List`1
Bindingsource
MyBindingSource

Any other ideas? Are tablestyles the only way to make a column invisible in
a datagrid in the compact framework?

Thanks
Kevin


I'm using VS 2005 with CF2.
The datasource of my datagrid is a List(of MyObject). All the properties
of
MyObject are visible as columns in the grid but i do not want all them to
be
visisble so I want to create a table style to do this. However, what
should
I use for the MappingName of the table style?
Thanks
Kevin

Try MyObject.

Kind regards,
Micha³

Hi Kevin

What you can try is debugging the bit after you assign the DataSource
property of the grid - check the dataGrid.m_tabstyActive field in the
Quick Watch window and look at the MappingName property. If the
correct name doesn't match the name you specify, a new table style is
created with the correct name and is accessible via m_tabstyActive
field.

That's how I found out the name to use in when I had a similar
problem.

Hope that helps,
Michal
 
K

Kev Westwood

Thanks Michal

The value of the property m_tabstyActive was "MyObject". I was sure i'd
already tried this as a tablestyle mapping name but i tried it again and it
worked!

How did you know about this property? if its there why isnt it public? i
suppose there are other hidden properties that are not exposed. How can you
findout what they are, use reflection maybe?

Regards
Kevin

Hi Michal

I have tried that but to no avail.

I have a variable called MyList which is the datasource of the grid and is
declared like this :

Dim MyList as New List(of MyObject)

I have also tried this variable name as the mapping.

If i do a GetType on MyList it returns "List`1". I have also tried this as
the mapping name.

I have also tried using a bindingsource and have same problem if i use the
name or type of the binding source

So heres the list of mapping names i have tried so far:

MyObject
MyObject[]
MyList
List`1
Bindingsource
MyBindingSource

Any other ideas? Are tablestyles the only way to make a column invisible
in
a datagrid in the compact framework?

Thanks
Kevin


I'm using VS 2005 with CF2.
The datasource of my datagrid is a List(of MyObject). All the properties
of
MyObject are visible as columns in the grid but i do not want all them
to
be
visisble so I want to create a table style to do this. However, what
should
I use for the MappingName of the table style?
Thanks
Kevin

Try MyObject.

Kind regards,
Micha³

Hi Kevin

What you can try is debugging the bit after you assign the DataSource
property of the grid - check the dataGrid.m_tabstyActive field in the
Quick Watch window and look at the MappingName property. If the
correct name doesn't match the name you specify, a new table style is
created with the correct name and is accessible via m_tabstyActive
field.

That's how I found out the name to use in when I had a similar
problem.

Hope that helps,
Michal
 
D

drozd

Glad I could help you :)

I've had real problem with finding the correct mapping name myself. At
one point I just started browsing through the properties using the
debugger to see what table style is used if it doesn't use the one I
specify and found m_tabstyActive with (fortunately) filled
mappingName.

I don't think you really need access to this property during runtime -
just use your own table style. On the other hand, being able to access
the active table style would make it a bit easier to modify the grid
appearance - it wouldn't be necessary to create a new table style just
for the sake of a single table.

Regards,
Michal

Thanks Michal

The value of the property m_tabstyActive was "MyObject".  I was sure i'd
already tried this as a tablestyle mapping name but i tried it again and it
worked!

How did you know about this property?  if its there why isnt it public?i
suppose there are other hidden properties that are not exposed.  How can you
findout what they are, use reflection maybe?

Regards
Kevin


Hi Michal
I have tried that but to no avail.
I have a variable called MyList which is the datasource of the grid andis
declared like this :
Dim MyList as New List(of MyObject)
I have also tried this variable name as the mapping.
If i do a GetType on MyList it returns "List`1". I have also tried thisas
the mapping name.
I have also tried using a bindingsource and have same problem if i use the
name or type of the binding source
So heres the list of mapping names i have tried so far:
MyObject
MyObject[]
MyList
List`1
Bindingsource
MyBindingSource

Any other ideas? Are tablestyles the only way to make a column invisible
in
a datagrid in the compact framework?
Thanks
Kevin

"drozd" <[email protected]> wrote in message
Try MyObject.
Kind regards,
Micha³

Hi Kevin

What you can try is debugging the bit after you assign the DataSource
property of the grid - check the dataGrid.m_tabstyActive field in the
Quick Watch window and look at the MappingName property. If the
correct name doesn't match the name you specify, a new table style is
created with the correct name and is accessible via m_tabstyActive
field.

That's how I found out the name to use in when I had a similar
problem.

Hope that helps,
Michal
 

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