looking for code samples on binding a datagrid to a sql mobile database with ability to name columns

  • Thread starter Thread starter Joanne
  • Start date Start date
J

Joanne

hi



I have used the sqlceresultset and resultview to do simple binding with text
boxes. Now I want to bind a datagrid to a resultset and change column names
and column widths etc... Any code samples out there?



I know I can set the datasource property of the grid to the resultset but
how can I set column names and column widths? Is this done through the
bindings object?



thanks
 
Yes, the BindingSource object.

You might be able to obtain some titdbits for what you need with these code
Visual Studio 2005 Beta 2 examples:

How to use the DataGrid on the Pocket PC
http://msdn2.microsoft.com/en-us/library/ms135759(en-US,VS.80).aspx

How to use the DataGrid on the Smarthone
http://msdn2.microsoft.com/en-us/library/ms135729(en-US,VS.80).aspx

As you probably know, the .NET Compact Framework datagrid is in a
separate assembly (System.Windows.Forms.DataGrid) and must have a reference
made to it in your project. The .NET Compact Framework does not support
DataGridView.

- Bruce Hamilton
.NET Compact Framework User Education

This code is provided as is and confers no rights.
 
Thanks Bruce,

But this example shows using a table as a datasource. How can I use a
SqlCeResultset with it?

I really hope you have an answer.

I need to use a SqlCeResultSet (sql mobile) and be able to set column
headers and widths

Is there someone at microsoft i can pay for support on this?

Thanks
 
Bruce,

What would i use for the datagridtablestyle.MappingName if my datasource is
a SqlCeResultSet and not a Table?

I think this would solve the problem.

Thanks again!
 
Hi Bruce,

I have been testing DataGridView using VS 2005 (VisualBasic) and the control
represents a vast improvement over DataGrid.
I was extremely disappointed to discover that DataGridView is not available
for NET ComnpactFramework as we would like to use it on a Psion NetBook
running currently on Windows Mobile 4.2. (Hopefully, this OS will be updated
to Windows CE 5.0.)

Robert Robinson
 
Back
Top