本人在用如下的代码对GridData的单元格进行写入的时候,提示.Text为只读,请问如何解决。
Set DataGrid1.DataSource = rsdim i as integer
dim j as integer
j=1
do while not rs.eof
    with grid
        for i=1 to rs.fields.count-1
          .col=i
          .row=j
          .text="sdfsadfasdf"
       next i
    end with
    rs.movenext
    j=j+1
loop

解决方案 »

  1.   

    Set DataGrid1.DataSource = rs
    ==>这行不要。
      

  2.   

    Set DataGrid1.DataSource = rs不要的话,对于.Col.Row的赋值是报错的
      

  3.   

    用DataGrid显示表中内容的那段代码,你是如何写的?
      

  4.   

    这是我Load中的所有的代码Dim rs As Recordset
        Dim strSql As String   
      strSql = Trim(Text2.Text) '得到Select语句
      ADO_OpenRecordSet(adoConntion, rs, strSql) '得到结果集  If rs.RecordCount = 0 Then
          MsgBox "Not Exist Record"
          Exit Sub
      End IfSet DataGrid1.DataSource = rsdim i as integer
    dim j as integer
    j=1
    do while not rs.eof
       with grid
       for i=1 to rs.fields.count-1
        .col=i
        .row=j
       .text="sdfsadfasdf"
      next i
    end withrs.movenextj=j+1loop
      

  5.   

    如何设置DataGrid的最大行最大列
      

  6.   

    .text为只读,一般为combo控件设置为不可写入的问题(设置值为2)
      

  7.   

    数据库中记录 不在combo的list中