Why column count is 0 for GridView

前端 未结 5 803
春和景丽
春和景丽 2021-01-28 04:37

Friends, I\'m populating a GridView in my asp.net application using following code.

    GridView grdExport = new GridView();
    DataSet dsRecord = objHelper.gRe         


        
5条回答
  •  暖寄归人
    2021-01-28 04:46

    Your GridViewColumn Column will be set after binding your data. So just show a MessageBox.Show to find the column count.

    grdExport.AutoGenerateColumns = false;
    MessageBox.Show(grdExport.Columns.Count.ToString());
    

提交回复
热议问题