当前位置:首页
开发技术指南» 文章正文
    引言:

 ·一个简单的问题    »显示摘要«
    摘要: begin query1.close; query1.sql.clear; query1.sql.add(delete from country where name="america"); query1.open end; 我想问一下这段代码,为什么要先query1.close然后再query1.open ......
    摘要: asp.net代码移到另一台机器上,可以打的开,可怎么调试不了? ......


怎样在datagrid控件中滚动动指定的一行

我知道一个条件可以在datafrid控件中找到确定的一行.  
  我怎么才能得到这行的行号,我怎么样让datagrid自动滚动到那一行.  
  谢谢大虾们的帮助.

NO.1   作者: fellowcheng

BindingContext[yourDataSource].Position=index;  
  index为你所选的行的索引  
   
  或者  
  直接  
  DataGrid.Select(index);

NO.2   作者: namhyuk

The   DataGrid   has   a   protected   GridVScrolled   member   that   can   be   used   to   scroll   the   grid.   To   use   it   ,   you   can   derive   from   DataGrid   and   and   a   ScrollToRow   method.    
   
  class   MyDataGrid   :   DataGrid  
  {  
          public   ScrollToRow(int   row)  
          {  
                  this.GridVScrolled(this,   ScrollEventArgs(Type.LargeIncrement,   row));  
          }  
  }  
  未经测试。  
 

NO.3   作者: moksha

看起来GirdVScrolled应该是protected   event。DataGrid既然没有提供访问这个protected成员的public方法或属性,所以只能继承后用public方法访问啦。不过,这种机制的作用是什么?俺一时想不明白。


    摘要: 我在internet信息服务中发现网站下面是停止的. 从新启动iis都不行. 我怀疑是不是原来在cmd把那些共享全部关闭了,修改注册表. 但是我忘了怎么改回来. 请问不能启动iis是怎么回事啊. 哪位帮我解决一下啊?? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE