how to use BulkEdit ?

Topics: Developer Forum
Apr 4, 2007 at 10:30 PM
I tried to use BulkEdit, but it falls in error when I click the save button, saying that the method is not supported.

I've installed the dll, in visual studio, changed the web.config file.

What do I need to do more ?
I don't see exactly where the "save button" command gets processed in the c# handler...

This is the file I'm using:

BulkEdit.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BulkEdit.aspx.cs" Inherits="BulkEdit" %>
<%--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button runat="server" ID="SaveButton" Text="Save Data" />
<rwg:BulkEditGridView ID="EditableGrid" DataSourceID="XmlDataSource1"
AutoGenerateColumns="False"
DataKeyNames="num" SaveButtonID="SaveButton" runat="server">
<Columns>
<asp:BoundField HeaderText="num" DataField="num" />
<asp:TemplateField SortExpression="num">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Rows="1" Width="300px"
Text='<%# XPath(".","{0}") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</rwg:BulkEditGridView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="text.xml"
XPath="/test/item1/P@num!=''"></asp:XmlDataSource>

</div>
</form>
</body>
</html>

BulkEdit.aspx.cs

// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BulkEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
}



and the xml source is:

<test>
<item1>
<P num="1">
test
</P>
</item1>
<item1>
<P num="2">
aasdasd
</P>
</item1>
</test>


Apr 5, 2007 at 1:58 PM
It's in the OnLoad. Search for this.SaveButtonID and you should see where it registers for an EventHandler.