Click here to Skip to main content
11,647,600 members (63,212 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 jyo.net 500
1 F-ES Sitecore 370
2 DamithSL 335
3 OriginalGriff 322
4 CPallini 290
0 OriginalGriff 1,277
1 jyo.net 994
2 DamithSL 946
3 Sergey Alexandrovich Kryukov 853
4 CPallini 760


Advertise | Privacy | Mobile
Web04 | 2.8.150804.2 | 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