Reading data from DataGridView in C#

后端 未结 5 1346
礼貌的吻别
礼貌的吻别 2020-12-01 14:40

How can I read data from DataGridView in C#? I want to read the data appear in Table. How do I navigate through lines?

5条回答
  •  既然无缘
    2020-12-01 14:58

     private void HighLightGridRows()
     {            
         Debugger.Launch();
         for (int i = 0; i < dtgvAppSettings.Rows.Count; i++)
         {
             String key = dtgvAppSettings.Rows[i].Cells["Key"].Value.ToString();
             if (key.ToLower().Contains("applicationpath") == true)
             {
                 dtgvAppSettings.Rows[i].DefaultCellStyle.BackColor = Color.Yellow;
             }
         }
     }
    

提交回复
热议问题