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

  • Thread starter Thread starter Joanne
  • Start date Start date
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!
 
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.
 
did you use a SqlCe Resultset? I create my resultset in code. Are you
creating yours through the designer?


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