Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- public static DataGrid grid { get; set; }
- public void dataGrid_Loaded(object sender, RoutedEventArgs e)
- {
- Thread thread = new Thread(SCMClient.connect);
- thread.IsBackground = true;
- thread.Start();
- create_columns();
- SCMClient.record_list.Add(new Record("Support-99", "ROBOTS", 0, 0.0, "", "OK", 0.0, 0, 0, 0.0, ""));
- grid = sender as DataGrid;
- grid.ItemsSource = SCMClient.record_list;
- grid.Items.Refresh();
- }
- public void create_columns()
- {
- var col1 = new DataGridTextColumn();
- col1.Header = "Station";
- col1.Binding = new Binding("Station");
- dataGrid.Columns.Add(col1);
- var col2 = new DataGridTextColumn();
- col2.Header = "UserName";
- col2.Binding = new Binding("UserName");
- dataGrid.Columns.Add(col2);
- var col3 = new DataGridTextColumn();
- col3.Header = "EvtTime";
- col3.Binding = new Binding("EvtTime");
- dataGrid.Columns.Add(col3);
- var col4 = new DataGridTextColumn();
- col4.Header = "LocCode";
- col4.Binding = new Binding("LocCode");
- dataGrid.Columns.Add(col4);
- }
- public void refresh_grid()
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement