Click here to Skip to main content
11,703,632 members (65,556 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 DataGrid
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 23-Jun-13 20:58pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
<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[^]
  Permalink  
v2
Comments
codingStar at 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)

  Print Answers RSS
0 OriginalGriff 550
1 Maciej Los 530
2 Sergey Alexandrovich Kryukov 381
3 Andy Lanng 294
4 CPallini 195
0 OriginalGriff 8,744
1 Sergey Alexandrovich Kryukov 7,747
2 CPallini 5,107
3 Maciej Los 4,716
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 24 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100