'宣言 Public Property FixedLocation As FixedRecordLocation
public FixedRecordLocation FixedLocation {get; set;}
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) ' If the current active record is a DataRecord then ' fix the record to the top of the display. ' Note: it is possible to fix other types of records (e.g. GroupByRecords) ' However, usually DataRecorcds are the only types of records to be ' fixed. In fact we don't provide a UI to fix anything but DataRecords If TypeOf Me.xamDataGrid1.ActiveRecord Is DataRecord Then Dim activeRecord As DataRecord = CType(Me.xamDataGrid1.ActiveRecord, DataRecord) ' Check to make sure that the record is not a special record ' (e.g. a FilterRecord or an 'Add' record) If Not activeRecord.IsSpecialRecord Then activeRecord.FixedLocation = FixedRecordLocation.FixedToTop End If End If End Sub
private void Button_Click(object sender, RoutedEventArgs e) { // If the current active record is a DataRecord then // fix the record to the top of the display. // Note: it is possible to fix other types of records (e.g. GroupByRecords) // However, usually DataRecorcds are the only types of records to be // fixed. In fact we don't provide a UI to fix anything but DataRecords DataRecord activeRecord = this.xamDataGrid1.ActiveRecord as DataRecord; // Check to make sure that the record is not a special record // (e.g. a FilterRecord or an 'Add' record) if (activeRecord != null && !activeRecord.IsSpecialRecord) activeRecord.FixedLocation = FixedRecordLocation.FixedToTop; }