Hi, this is my first post on this thread.
I have a datagrid with a checkbox. I followed the one on msdna2 site using a tablestyle etc.
However, i want to do update using all the ones the user has checked.
I can do this for one single checked item and i can get the value that i require, but i am unsure of how to get all the checked items.
I am unsure of what to write for the for loop.
Any ideas. Mine is almost the same as the msdna.
Private Sub BoolCellClicked(ByVal sender As Object, ByVal e As BoolValueChangedEventArgs)
'Console.WriteLine("BoolCellClicked")
Me.DataGrid1.EndEdit(Me.DataGrid1.TableStyles(0).GridColumnStyles("Discontinued"), e.Row, False)
RefreshRow(e.Row)
Me.DataGrid1.BeginEdit(Me.DataGrid1.TableStyles(0).GridColumnStyles("Discontinued"), e.Row)
End Sub
Private Sub FormatGridRow(ByVal sender As Object, ByVal e As DataGridFormatCellEventArgs)
' Conditionally set properties in e depending upon e.Row and e.Col.
Dim discontinued As Boolean = CBool(IIf(e.Column <> 0, Me.DataGrid1(e.Row, 0), e.CurrentCellValue)) 'TODO: For performance reasons this should be changed to nested IF statements
' Check if discontinued?
If e.Column > 0 AndAlso CBool(Me.DataGrid1(e.Row, 0)) Then 'discontinued?
e.BackBrush = Me.disabledBackBrush
e.ForeBrush = Me.disabledTextBrush
ElseIf e.Column > 0 AndAlso e.Row = Me.DataGrid1.CurrentRowIndex Then 'currentrow?
e.BackBrush = Me.currentRowBackBrush
e.TextFont = Me.currentRowFont
End If
End Sub