lblMSG.Text=yourDataGrid.Columns.Count.ToString();
你是不是打错了大小写