.NET爱好者

——努力不一定成功,但成功需要不懈的努力!

用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
lubosun的公告
<script defer="defer" id="snap_preview_anywhere" type="text/javascript" src="http://spa.snap.com/snap_preview_anywhere.js?ap=1&amp;key=13737dfb4ebeeb2fe0bedc4053db0631&amp;sb=1&amp;domain=blog.csdn.net/lubosun/"></script> <img src="http://static.asp.net/asp.net/images/MicrosoftASPNET.gif" /> <br/> <iframe src="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=b44686ce8c51e841%40apps.messenger.live.com&mkt=zh-cn" width="300" height="300" style="border: solid 1px black; width: 200px; height: 300px;" frameborder="0"></iframe>
文章分类
友情链接
我的sharepoint2007群组
存档

转载  安装vs2003一开始,安装程序检测到另一个程序要求计算机重新启动,重启n次无效 的问题 收藏

解决办法:

在注册表删除

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\pendingfilerenameoperations

===================//DataGrid翻页

private void PageCut_Click(object sender,System.EventArgs e)

        { 
            String commangArg
=((LinkButton)sender).CommandArgument;
     
            
switch(commangArg)
            {
                
case "First":
                {
                    CustomerDatagrid.CurrentPageIndex
=0;
                    
break;
                }
                
case "Prev":
                {
                    CustomerDatagrid.CurrentPageIndex
=(int)Math.Max (0,CustomerDatagrid.CurrentPageIndex-1);
                    
break;


                }
                
case "Next":
                {
                    CustomerDatagrid.CurrentPageIndex
=(int)Math.Min(CustomerDatagrid.CurrentPageIndex-1,CustomerDatagrid.CurrentPageIndex+1);
                    
break;
                }
                
case "Last":
                {
                    CustomerDatagrid.CurrentPageIndex
=CustomerDatagrid.PageCount-1;
                    
break;
                }
                
default:break;    
                    
            }
            BindDataGrid();

   

        }

//datagrid多表头

private void dg_equip_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        
{
            
if(e.Item.ItemType == ListItemType.Header)
            
{
                DataGridItem head 
= (DataGridItem)e.Item;                
                e.Item.Cells.Clear();
                
                System.Text.StringBuilder sb 
= new System.Text.StringBuilder();    
//                sb.Append("</td></tr><tr style='COLOR: #003399; HEIGHT: 20px; BACKGROUND-COLOR: #35c6c9'>");
                sb.Append("&nbsp;</td>");    
                
                sb.Append(
"<td rowspan='2'>委托单位</td>");
                sb.Append(
"<td colspan='2'>信息系统及服务</td>");
                sb.Append(
"<td colspan='2'>表计</td>");
                sb.Append(
"<td colspan='2'>办公用品</td>");
                sb.Append(
"<td colspan='2'>检测设备及仪器</td>");
                sb.Append(
"<td colspan='2'>实验设备及仪器</td>");
                sb.Append(
"<td colspan='2'>其它</td>");
                sb.Append(
"</tr>");
                sb.Append(
"<tr style='COLOR: #003399; HEIGHT: 20px; BACKGROUND-COLOR: #35c6c9'>");                
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                sb.Append(
"<td>数量</td>");
                sb.Append(
"<td>金额</td>");
                    
                TableCell tc
= new TableCell();                
                tc.RowSpan
=2;
                tc.Text
=sb.ToString();
                e.Item.Cells.Add(tc);                                        
                
            }

//datagrid合并行

 private    string type1="";
        
private int rows2 = 1;
        
private int item2 = 1;
        
private void rpt_body_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        {        
            
            DataGrid dg
=(DataGrid)sender;
            
if(dg.Items .Count ==0)
            {
                type1
="";
                rows2 
= 1;
                item2 
= 1;

            }

            
if (e.Item.ItemType == ListItemType.Item|| e.Item.ItemType == ListItemType.AlternatingItem)
            {
                
                    dgstyle.SetDataGridBackColor(e.Item);                        
                
            }

            
//合并相同电压类型
        
            
if(e.Item.ItemType!=ListItemType.Header&&e.Item.ItemType!= ListItemType.Footer&&e.Item.ItemType!= ListItemType.Pager)
            {
                
                
                
try
                {
                    
                    
if(e.Item.Cells[0].Text!=type1)
                    {
                        
                        
if(rows2>1)
                        {
                            dg_data.Items[item2].Cells[
0].RowSpan = rows2;
                        }
                        rows2 
= 1;
                        item2 
= e.Item.ItemIndex;
                        type1
=e.Item.Cells[0].Text;
                    
                    }
                    
else
                    {
                        rows2 
++;
                        e.Item.Cells[
0].Visible=false;
                    }
                }
                
catch{}
            }
                
            
else
            {
                
if(rows2>1 )
                {
                    
if(dg.Items .Count >1)
                    {
                        dg.Items[item2].Cells[
0].RowSpan = rows2;
                    }
                    
                }

                
            }
            
        }

 //js导入EXCEL、WORD

//指定页面区域内容导入Excel
 function AllAreaExcel(ElementName) 
 {
  
//alert('ddddd');
  var oXL = new ActiveXObject("Excel.Application"); 
  
var oWB = oXL.Workbooks.Add(); 
  
var oSheet = oWB.ActiveSheet;  
  
var sel=document.body.createTextRange();
  sel.moveToElementText(document.getElementById(ElementName));
  sel.select();
  sel.execCommand(
"Copy");
  oSheet.Paste();
  oXL.Visible 
= true;
 }
 
//指定页面区域“单元格”内容导入Excel
 function CellAreaExcel(ElementName) 
 {
var obj=document.getElementById(ElementName);
  
var oXL = new ActiveXObject("Excel.Application"); 
  
var oWB = oXL.Workbooks.Add(); 
  
var oSheet = oWB.ActiveSheet; 
  
var Lenr = obj.rows.length;
  
for (i=0;i<Lenr;i++
  { 
   
var Lenc = obj.rows(i).cells.length; 
   
for (j=0;j<Lenc;j++
   { 
    oSheet.Cells(i
+1,j+1).value = obj.rows(i).cells(j).innerText; 
   } 
  } 
  oXL.Visible 
= true
 }

 
//指定页面区域内容导入Word
 function AllAreaWord(ElementName)
 {
    
// alert('ddddd');
  var oWD = new ActiveXObject("Word.Application");
  
var oDC = oWD.Documents.Add("",0,1);
  
var oRange =oDC.Range(0,1);
  
var sel = document.body.createTextRange();
  sel.moveToElementText(document.getElementById(ElementName));
  sel.select();
  sel.execCommand(
"Copy");
  oRange.Paste();
  oWD.Application.Visible 
= true;
  
//window.close();
 }

 //中文转GB2312

private void LinkButton1_Click(object sender, System.EventArgs e)
        {
            
//LinkButton1.Text="北京";
            Response.Redirect ("http://map.baidu.com/#word="+System.Web.HttpUtility.UrlEncode(this.LinkButton1 .Text .ToString (),System.Text .Encoding.GetEncoding ("gb2312"))+"&ct=10");
        }

发表于 @ 2007年11月06日 16:00:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:Oracle 相关 | 新一篇:[转]大型Web2.0站点构建技术初探

  • 发表评论
  • 评论内容:
  •  
Copyright © lubosun
Powered by CSDN Blog