Exemplo n.º 1
0
 private void SnapshotObjectsPanel_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         if (myServer.dataRefreshInterval != 0)
         {
             ObjectsRefreshTimer.Interval = myServer.dataRefreshInterval;
             ObjectsRefreshTimer.Start();
         }
         refreshObjectsTable();
         ObjectsDataGrid.AutoResizeColumns();
     }
     else
     {
         if (myServer.dataRefreshInterval != 0)
         {
             ObjectsRefreshTimer.Stop();
         }
     }
 }
Exemplo n.º 2
0
        private void ApplyFilter()
        {
            DataTable newTable = new DataTable();

            foreach (DataColumn dc in wholeTable.Columns)
            {
                newTable.Columns.Add(dc.ColumnName);
            }

            foreach (DataRow dr in wholeTable.Rows)
            {
                if (((string)dr["OBJECT_ID"]).IndexOf(FilterTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    newTable.Rows.Add(dr.ItemArray);
                }
            }

            ObjectsDataGrid.DataSource = newTable;
            foreach (DataGridViewTextBoxColumn col in ObjectsDataGrid.Columns)
            {
                col.ToolTipText = ActivityViewer.ProgramManager.GetToolTipText(col.HeaderText);
            }
            ObjectsDataGrid.AutoResizeColumns();
        }