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

    摘要: 1、immgetopenstatus函数在没有输入法和有输入法但使用immsetopenstatus函数关闭后返回的都是false,有没有什么方法区分这两种情况? 2、我使用win2000操作系统,在#include "imm.h"和#pragma comment(lib, "imm32.lib")后immgetopenstatus函数和immset......
    摘要: 我的机器被人删了软驱,如何恢复,怀疑在cmos里被人删了,有没有高手给个详细的步骤指点 ......


动态添加表格的问题

我想动态添加一个表格,用dropdownlist中的数值控制他的大小,并在指定的地方加入textbook控件。

NO.1   作者: adandelion

参考下列代码。  
  <asp:Table   id="Table1"   runat="server"   BorderWidth="1px"   Width="158px"   CellPadding="0"   CellSpacing="0"></asp:Table>  
  ///   <summary>  
  ///   输出菜单  
  ///   </summary>  
  private   void   showMenue()  
  {  
  DataSet   ds   =   connE.GetDs("father","select   *   from   menues   where   parentId=1   and   state=1   order   by   id");  
  DataView   dv   =   ds.Tables["father"].DefaultView;  
  int   i=0;  
  foreach(   DataRowView   dvR   in   dv)  
  {  
  //一级菜单  
  TableRow   tr   =   new   TableRow();  
  TableCell   tc   =   new   TableCell();  
  tc.Text=dvR["name"].ToString();  
  tc.CssClass="title1";  
  tc.Attributes["onclick"]="showsubmenu("+i+")";  
  tc.Width=158;  
  tc.Height=25;  
  tr.Cells.Add(tc);  
  Table1.Rows.Add(tr);  
   
  //二级菜单  
  TableRow   tr2   =   new   TableRow();  
  TableCell   tc2   =   new   TableCell();  
  tc2.ID="submenu"+i;  
  tc2.Attributes["style"]="disply:none";  
   
  Table   tbChild   =   new   Table();  
  tbChild.CssClass="title2";  
  tbChild.Attributes["width"]="100%";  
   
  DataSet   dsChild;  
  string   strSql="select   *   from   menues   where   parentId="+dvR["id"]+"   and   state=1";  
  dsChild   =   connE.GetDs("child",strSql);  
  DataView   dvChild   =   dsChild.Tables["child"].DefaultView;  
  foreach   (   DataRowView   dvRChild   in   dvChild)  
  {  
  TableRow   trChild   =   new   TableRow();  
  TableCell   tcChild   =   new   TableCell();  
   
  tcChild.Attributes["align"]="Center";  
  HyperLink   hl   =   new   HyperLink();  
  hl.Text=dvRChild["name"].ToString();  
  hl.NavigateUrl=dvRChild["url"].ToString();  
  hl.Target="main";  
  tcChild.Controls.Add(hl);  
   
  trChild.Cells.Add(tcChild);  
  tbChild.Rows.Add(trChild);  
  }  
  tc2.Controls.Add(tbChild);  
  tr2.Cells.Add(tc2);  
  Table1.Rows.Add(tr2);  
  //dsChild.Tables.Clear();  
  i++;  
   
  }  
  }


 ·sql语句如何写    »显示摘要«
    摘要: 查询学生表中的及格的人数,并计算出优秀率。 ......
» 本期热门文章:

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