Note that there are some explanatory texts on larger screens.

plurals
  1. POGet value from the datagrid after press button/using datagrid selection changed
    primarykey
    data
    text
    <p>i have a datagrid that load the data from my database. in my datagrid, i also included the , so that i can checked or unchecked the row. </p> <p>here is the picture. <img src="https://i.stack.imgur.com/q1nXb.png" alt="enter image description here"></p> <p>here is my xaml.</p> <pre><code>&lt;DataGrid AutoGenerateColumns="False" Height="258" HorizontalAlignment="Left" Margin="12,0,0,12" Name="dataGrid1" VerticalAlignment="Bottom" Width="479" ItemsSource="{Binding data}" AlternatingRowBackground="#FFC4B0B0"&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTextColumn Binding="{Binding nCateogryID}" Header="No." IsReadOnly="True" Width="30" /&gt; &lt;DataGridTextColumn Binding="{Binding sCategoryDesc}" Header="Nama Kategori" IsReadOnly="True" Width="160" /&gt; &lt;DataGridTextColumn Binding="{Binding sCategoryItems}" Header="Keterangan Kategori" IsReadOnly="True" Width="170" /&gt; &lt;DataGridCheckBoxColumn Header="Checked?" /&gt; &lt;/DataGrid.Columns&gt; &lt;/DataGrid&gt; </code></pre> <p>May question is: How can i know which data already checked whenever i hit the 'Button'? I also do search on google, but found nothing. </p> <p>i think like this. whenever i click 'Button', i will start to check for each row. how can i do it? any sample for that?</p> <p>i also think to find another solution, how about using the event handler? thats mean whenever i click for the row and checked, i will trigger the event and check if is it checked or not. How can i do it? </p> <p>For me, using the event handler is more achieveable because it's much faster rather i have to checked, and press button. lets say if i have only 10 rows, that's not a big problem. How about if i have 1000rows? if i check one by one, it will be troublesome. waste alot of time. any idea? thanks. </p> <p>Or maybe use the datagrid_selectionchanged. How can i check the checkbox has been checked or not? </p> <p>because if we wait until user press button, then we check is checked or not, i think its a slow process. you have to check for each row. if my row only 10rows, maybe its okay. how about if i have 1000 rows need to check? thanks. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload