Vb教程 Vb.net教程 Vfp教程 C/C++教程 Vc/Vc++教程 Delphi教程 Java教程 Powerbuilder
  杀毒频道 | 短信频道 | 网络电视 | 论文中心 | 学上网 | 学软件 | 网页特效 | 电脑基础 | 论坛  
  NCRE | 软考 | CET | 职称英语 | 司法考试 | 报关员 | 公务员 | CATTI | CPA考试  
  Html教程 | Css教程 | Xml教程 | Asp教程 | Asp.net | Php教程 | Jsp教程 | Linux教程 | QQ技巧  
Photoshop Illustrator ImageReady Maya教程 3D Max教程 Lightscape Coredraw教程 Authorware Autocad教程 Freehand教程
Access教程 Mysql教程 Sql server Oracle教程 Word教程 Excel教程 Powerpoint Frontpage Asp.net源码 Php源代码
Flash教程 Fireworks Dreamweaver C#教程 outlook教程 系统安装 vbscript教程 Javascript Jsp源代码 Asp源代码
您的位置:首页 >> Vb.net教程 >> 正文



<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">

Sub Page_Load(Src As Object, E As EventArgs)
        If Not (IsPostBack)
        End If
End Sub

Sub DataLoad(parmsort as string)
         Dim ds As New DataSet
        Dim FS As New FileStream(Server.MapPath("books.xml"), FileMode.Open)
        MyDataGrid.DataSource = new DataView(ds.Tables(0))

Sub DataSort(Src As Object, E As DataGridSortCommandEventArgs)
    ' Bug if we sort, then Edit Item Becomes Wrong
    IF MyDataGrid.EditItemIndex=-1 THEN
        response.write ("Can't sort until editing is done!")
    END IF
End Sub   

Sub DataDelete(Sender As Object, E As DataGridCommandEventArgs)
    DIM deletekey as string
    IF MyDataGrid.EditItemIndex=-1 THEN
        response.write ("deleted " & deletekey)
        response.write ("Can't delete until editing is done!")
    END IF

Sub DataEdit(Sender As Object, E As DataGridCommandEventArgs)
        DIM editkey as string
        MyDataGrid.EditItemIndex = Cint(E.Item.ItemIndex)
        'response.write ("To Be Edited" & editkey)
End Sub

Sub DataCancel(Sender As Object, E As DataGridCommandEventArgs)
        MyDataGrid.EditItemIndex = -1
        response.write ("edit was cancelled")
End Sub

Sub DataUpdate(Sender As Object, E As DataGridCommandEventArgs)
        DIM editkey as string
        MyDataGrid.EditItemIndex = -1
       editkey = MyDataGrid.DataKeys(CInt(E.Item.ItemIndex))
       response.write ("To Be Updated " & editkey)
       ' howmanycols = E.Item.Cells.Count
End Sub



<h3><font face="Verdana">The Best Books Ever</font>
<span runat="server" id="MySpan"/></h3>

<form runat="server">
<ASP:DataGrid id="MyDataGrid" runat="server"



      <asp:ButtonColumn Text="Delete Book" CommandName="Delete"/>
      <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" ItemStyle-Wrap="false"/>


By the way, here is the XML source for this example:
Run This Code

    <author>Jack Trout, Steve Rivkin</author>
    <title>The Power of Simplicity</title>
    <comments>A Real Fun Read</comments>
    <author>Al Reiss, Jack Trout</author>
    <title>22 Immutable Laws of Marketing</title>
    <comments>This team offers more profound advice about creating world class marketing campaigns that will be viable for a hundred years.</comments>

    <author>Al Reiss, Laura Reiss</author>
    <title>22 Immutable Laws of Branding</title>
    <comments>This book is great for people who used 22 Immutable Laws of Marketing to build a brand and now want to strengthen that brand.</comments>
    <author>Tom Peters</author>
    <title>Circle of Innovation</title>
    <comments>His most recent book is his best by far!</comments>
    <author>Eli Goldthrait</author>
    <title>The Goal</title>
    <comments>Advocate of Theory of Constraints as applied to managment and optimization.</comments>

    <author>Jeff Cox, Howard Stevens</author>
    <title>Selling the Wheel</title>
    <comments>Excellent Treatise/Novel on the entire Sales Cycle</comments>

    <author>Alan Cooper</author>
    <title>The Inmates Are Running The Asylum</title>
    <comments>The father of Visual Basic and creator of the new art of Interaction Design - very valuable in designing websites. Basically the worlds most  cutting edge thinker in User Interface design aimed at simplifying software use.</comments>


编程语言 web开发 数据库 网络技术 操作系统 服务器 网页设计 图形设计 办公软件 常用软件 学电脑

Copyright© www.bianceng.cn Powered by 编程入门网 All Rights Reserved.
关于本站 | 版权声明 | 联系我们 | 友情链接 |
编程入门网 版权所有