datagridview 滚动条问题与绑定问题!!
我在winform添加一个datagridview,通过下列代码进行绑定。
Scroll选择为both
在窗体显示后,竖滚动条没有反映。水平滚动条可以作用。请问如何解决竖滚动条没有反映的问题?
另外能否通过dataset来绑定dataGridView?
…… conn.Open(); SqlCommand comm = new SqlCommand(); comm.CommandText = "Select top 500 voicefile FROM GSMVoiceInfo WHERE (tPhone = '14444440') AND (LEN(VoiceFileName) > 0)"; comm.CommandTimeout = 300; comm.Connection = conn; SqlDataReader dr; dr = comm.ExecuteReader(); int i = 0; while (dr.Read()) { //i++; this.dataGridView1.Rows.Add(new ListViewItem(dr.GetString(dr.GetOrdinal("voicefile ")))); } conn.Close();