目前,我有《数据集》和一些标签。 如果数据GridView的选定活动发生,标识应填满选定的浏览量,且无问题。 但是,如果我对数据GridView进行分类并一行点击,标签中的信息是错误的。
活动:
Private Sub DGVMain_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DGVMain.SelectionChanged
If DGVMain.SelectedRows.Count > 0 AndAlso Not Me.DGVMain Is Nothing Then
Dim index As Integer = DGVMain.SelectedRows(0).Index
Dim row As ResultSet.ResultsRow = CType(DGVMain.DataSource, ResultSet.ResultsDataTable).Rows(index)
SetDetails(row)
End If
End Sub
列出标签的细节:
Private Sub SetDetails(ByVal row As ResultSet.ResultsRow)
Dim rounding As Integer = 0
If row.AssayDisplayResultFormat.Contains(":") Then
rounding = Integer.Parse(row.AssayDisplayResultFormat.Split(":")(1))
End If
LBResultValue.Text = Round(row.ResultResultValue * row.AssayDisplayResultFactor, rounding) & " " & row.AssayDisplayResultUnit
LBAssayNameValue.Text = row.AssayDisplayShortName & " (" & row.AssayOID & ")"
LBSampleIdValue.Text = row.ResourceName
LBCreationDateValue.Text = row.ResourceCreated
LBFlagsValue.Text = ""
LBRawValue.Text = Round(row.ResultRawValue, rounding) & " " & row.AssayDisplayResultUnit
End Sub