DataGrid doesn't display changes ???

C

Chris

Hi,

using a DataGrid :

I set the TableStylesCollection and GridColumnStyles at designtime .. map to
a DataSource and everything ..
but the Datagrid doesn't use those settings (not at design-time nor at
runtime) ???

It always uses the default layout being : showing all the columns that are
available in the DataSet it is bound to.

What am I doing wrong ?

If I set the TableStylesCollection and GridColumnStyles at runtime (setting
the DataGrid styles in code) then it works when I run the program.

Thanks

Chris
 
C

Chris

Hi,

thanks for your suggestion but ...
I have no coding to show... that's my whole point. I've been doing it the
way you do in your code and it works ... but I try to make it work as well
without having to code the styles, so just by setting the properties of the
DataGrid at design time.

try it out : select the properties of the DataGrid, set the DataSource to a
created DataSet-object (via the dataadapter is how I created the
DataSet-obj)
and then set the TableStylesCollection and GridColumnStyles properties

But it doesn't work. Well, the grid accepts the properties (no errors or
anything) but it displays in the form just the same as before setting any
style-properties at all ??

Any ideas ?

I executed dataGrid1.Update() or refresh() .. nothing. and actually I would
like see the changes without have to execute the app first (it works fine if
using a web-DataGrid in a WebForm, there yhou see the changes even before
running the app)

Thanks

Chris
 
C

Cor Ligthert

Hi Chris,

The most forgotten thing is always is not setting the Mappingname from the
styles to the right table, however you told you did, are we talking about
the same, the Mappingname in the Styles propertie box?

You can of course show us the code, when you open the plus on the designer
created code you will see somewhere someting as
'
DataGridTableStyle1
'
You can copy that, paste it in a notebook, copy that back and show us that.

Maybe we can help you then better when my answer above does not.

Cor
 
S

scorpion53061

Post the code that fills your dataset and the code that you are using for a
style. I know you said you are doing what Bill is doing but I want to see if
you are mapping properly.
 
C

cmrchs

Indeed , that's why !

I forgot to set the MappingName of the TableStyles-coll to the name of the table used in the DataSet

Thanks Cor !!!

Chris

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

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