Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,all

i an doing an windows mobile development. i currently got a datagrid and i want to add another column which is tickbox in the first column. so that i can tick to choose which row i want to select since the datagrid will return many rows. In another word, the data rows returned from the webservice can be clearly shows which rows are the ones i want.

many thanks in advance
Posted

1 solution

I know nothing about windows mobile development.
But I did the same in wpf yesterday. Maybe you can use it or otherwise say it and I will clean it.
XML
<DataGrid   IsEnabled="True" CanUserResizeRows="False" CanUserDeleteRows="False" Height="200" x:Name="Games_Grid" MaxHeight="400" ItemsSource="{Binding GameOverview}"  FontSize="16" SelectedItem="{Binding SelectedGameOverview}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"  mvvm:SelectedItemsBehavior.SelectedItemsChangedHandler="{Binding Path=ResultsSelectionChangedCommand}">
            <DataGrid.RowHeaderTemplate>
                <DataTemplate>
                    <Grid>
                        <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor,  AncestorType={x:Type DataGridRow}}}"/>
                    </Grid>
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>
       </DataGrid>



The SelectedItemBehavior I have from:
http://stackoverflow.com/questions/1579700/wpf-toolkit-datagrid-multi-select-how-to-get-selecteditems-out[^]
 
Share this answer
 
v2
Comments
codingStar 24-Jun-13 18:50pm    
windows development in vs 2008 is more like winform. unfortunately it doesn't have this function. has anyone done this before.

thanks anyway

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900