Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Getting values from checkboxes in a XamDataGrid
posted

I have a XamDataGrid with checkboxes in one of the columns.

<igDP:UnboundField Name="unbAddToRefresher"

  Label="Add To Refresher"  Width="150">

  <igDP:UnboundField.Settings>

     <igDP:FieldSettings>

       <igDP:FieldSettings.CellValuePresenterStyle>

         <Style TargetType="{x:Type igDP:CellValuePresenter}" >

           <Setter Property="Template">

             <Setter.Value>

               <ControlTemplate>

                 <CheckBox Name="chkChooseForRefresher"  HorizontalAlignment="Center"  VerticalAlignment="Center">

                 </CheckBox>

               </ControlTemplate>

             </Setter.Value>

           </Setter>

         </Style>

       </igDP:FieldSettings.CellValuePresenterStyle>

     </igDP:FieldSettings>

   </igDP:UnboundField.Settings>

 </igDP:UnboundField>

 

When I click a button on the page, I would like to loop through all rows and save a field value from this row if the checkbox is checked.

In ASP.Net, I would do this on the button's click event handler -

     For index As Integer = 0 To GridView1.Rows.Count - 1

         Dim cb As CheckBox = CType(GridView1.Rows(index).FindControl("chkChooseMe"), CheckBox)

             If cb.Checked Then ...

 

For WPF with Infragistics, I'm not sure what to do. I tried this, but it didn't work -

    For index As Integer = 0 To XamDataGrid1.Records.Count - 1

         Dim cb As CheckBox = CType(dgrRefresher6166.Records(index).FindControl("chkCreateDocumentsRowLevel"), CheckBox)

This give the error - 'FindControl' is not a member of 'Infragistics.Windows.DataPresenter.Record'

 

How can I read the values of the checkboxes?

Thanks!