In WM ApplicationProgramYou must use the most powerful DataGrid. In. Net CF, The DataGrid has been completely weakened.
The following questions are some of the questions that many netizens have encountered during development. I would like to summarize them and hope to help you.
Note some details during actual development.
We may retrieve the data sources of n columns at a time, and some do not want to be displayed in DG. We can create a column first, and then set the mappingname of the specified column.
At this time, the column data corresponding to mappingname is not displayed.
How to Create a column header?
Create a datagridtablestyle by using the datagird tablestyle attribute.
Create more than one datagridcolumnstyle and specify its mappingname.
If mappingname cannot be found in the data source, it is not displayed (case sensitive)
Can I create only tablestyle?
Of course, you only need to specify the mappingname of tablestyle. If you do not create columnstyle, all columns in the data source will be bound.
Once columnstyle is created, it is displayed according to columnstyle. Even if columnstyle does not exist (all columns are not displayed ).
Why cannot I hide columns?
The column in The initird in. Net CF does not support the visiable attribute.
We only need to set its width attribute to 0 so that it is not displayed. (coincidentally)
Does the master-Details method be supported?
This method is not supported. We can implement it by ourselves, but the. net cf DataGrid itself does not.
How to obtain the current row and column?
Use columnnumber (column index subscript) and rownumber (row index subscript) of currentcell of the DataGrid object ).
How to drag columns in the DataGrid?
. Net CF certainly does not support pulling. Of course, we implement it by ourselves,
The following image example is used to hide a column.
Data Binding. Select a row.
See? We selected 5th rows and asked if we wanted to hide this row?
Have you seen it? The 2nd column is hidden, and the result is after the width is set to 0. You can pull the 2nd column from there.
CodeDownload:Devicetechdemo.rar
Running Environment: vs2008+ Wm6.0 +. Net cf3.5
Author: appleseeker (Feng)
Date: 2009-2-12
introduction: mobile development index