惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
G
GRAHAM CLULEY
S
Securelist
P
Palo Alto Networks Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
B
Blog RSS Feed
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
K
Kaspersky official blog
D
Docker
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
H
Help Net Security
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
美团技术团队
腾讯CDC

博客园 - 海蓝心

业余时间折腾了个微信小程序版本的街机游戏模拟器(吾爱街机),8090后的童年回忆,欢迎大家体验 Flex Formatter (flex ide 代码格式工具) 安装Android 开发工具 (二) Android 是什么 (一) 个性化印品DIY制作软件《光影21度》(.net客户端与flex通信技术) flash 电子相册 功能强大 在线传输软件 支持断点续传 flex版 个性化数码印刷在线diy 学习XSLT的知识积累 XMLHttpRequest介绍 委托学习笔记二(多播委托) 委托学习笔记一(调用委托) 委托和事件— 一个虚构的故事 ASP.NET程序中常用的三十三种代码(6) ASP.NET程序中常用的三十三种代码(3) ASP.NET程序中常用的三十三种代码(4) ASP.NET程序中常用的三十三种代码(2) ASP.NET程序中常用的三十三种代码(1) C#有关基础知识汇集
ASP.NET程序中常用的三十三种代码(5)
海蓝心 · 2005-11-18 · via 博客园 - 海蓝心

  24.DataGrid选定比较底下的行时,为什么总是刷新一下,然后就滚动到了最上面,刚才选定的行因屏幕的关系就看不到了。
  
  page_load
  page.smartNavigation=true
  
    25.在Datagrid中修改数据,当点击编辑键时,数据出现在文本框中,怎么控制文本框的大小 ?
  
  private void DataGrid1_ItemDataBound(obj sender,DataGridItemEventArgs e)
  {
   for(int i=0;i<e.Item.Cells.Count-1;i++)
    if(e.Item.ItemType==ListItemType.EditType)
    {
     e.Item.Cells[i].Attributes.Add("Width", "80px")
    }
  }
  
    26.对话框
  
  private static string ScriptBegin = "<script language=\"JavaScript\">";
  private static string ScriptEnd = "</script>";
  
  public static void ConfirmMessageBox(string PageTarget,string Content)
  {
   string ConfirmContent="var retValue=window.confirm(’"+Content+"’);"+"if(retValue){window.location=’"+PageTarget+"’;}";
  
   ConfirmContent=ScriptBegin + ConfirmContent + ScriptEnd;
  
   Page ParametERPage = (Page)System.Web.HttpContext.Current.Handler;
   ParameterPage.ReGISterStartupScript("confirm",ConfirmContent);
   //Response.Write(strScript);
  }
  
    27. 将时间格式化:string aa=DateTime.Now.ToString("yyyy年MM月dd日");
  
    1.1 取当前年月日时分秒
  
  currentTime=System.DateTime.Now;
  
    1.2 取当前年
  
  int 年= DateTime.Now.Year;
  
    1.3 取当前月
  
  int 月= DateTime.Now.Month;
  
    1.4 取当前日
  
  int 日= DateTime.Now.Day;
  
    1.5 取当前时
  
  int 时= DateTime.Now.Hour;
  
    1.6 取当前分
  
  int 分= DateTime.Now.Minute;
  
    1.7 取当前秒
  
  int 秒= DateTime.Now.Second;
  
    1.8 取当前毫秒
  
  int 毫秒= DateTime.Now.Millisecond;
  
    28.自定义分页代码:
  
    先定义变量 :
  
  public static int pageCount; //总页面数
  public static int curPageIndex=1; //当前页面
  
    下一页:
  
  if(DataGrid1.CurrentPageIndex < (DataGrid1.PageCount - 1))
  {
   DataGrid1.CurrentPageIndex += 1;
   curPageIndex+=1;
  }
  
  bind(); // DataGrid1数据绑定函数
  
    上一页:
  
  if(DataGrid1.CurrentPageIndex >0)
  {
   DataGrid1.CurrentPageIndex += 1;
   curPageIndex-=1;
  }
  
  bind(); // DataGrid1数据绑定函数
  
    直接页面跳转:
  
  int a=int.Parse(JumpPage.Value.Trim());//JumpPage.Value.Trim()为跳转值
  
  if(a<DataGrid1.PageCount)
  {
   this.DataGrid1.CurrentPageIndex=a;
  }
  
  bind(); 
  

posted on 2005-11-18 10:43  海蓝心  阅读(266)  评论()    收藏  举报