how do i use the sql mobile resultsetview to set column names for a bound data grid?

J

Joanne

Hi

I'm using a datagrid that is bound to a sql mobile SqlCeResultSet using a
ResultSetView (datagrid.datasource = myResultSetView).
How can I set the column headers?

Thanks very much!
 
C

Chris Botha

Do you mean how to change them? This is done by adding a TableStyle to the
grid itself, same when binding a DataTable. You may find complete examples
on the Web, but shortly this is what has to be done.
Click on the grid and find the TableStyles collection in the properties.
Click next to collection, click the button that appears, and then click Add.
In the right hand pane click next to collection in the GridColumnStyle
property and click the button that appears.
For each column in the ResultSet to be displayed:
Click Add, type in the header in the HeaderText property and the
corresponding column name in the MappingName property.
 
J

Joanne

did you use a SqlCe Resultset? I create my resultset in code. Are you
creating yours through the designer?


Thanks Chris
 
C

Chris Botha

Yes, I used SqlCeResultSet, pretty much as in your first example.
Did you try it, or are you just researching the theory?
 

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