<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IsAllowDelivery.aspx.cs" Inherits="ERP.Web.Finance.Agent.IsAllowDelivery" %>

<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Data.Linq" tagprefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript"> </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div> <dx:ASPxButton ID="ASPxButton1" runat="server" OnClick="ASPxButton1_Click" Text="保存">
</dx:ASPxButton> </div>
<div>
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" ClientInstanceName="grid1" DataSourceID="SqlDataSource1" KeyFieldName="代码" Width="266px" OnRowUpdating="ASPxGridView1_RowUpdating">
<clientsideevents rowclick="function(s, e) {
grid1.StartEditRow(e.visibleIndex);
}" />
<Columns>
<dx:GridViewDataTextColumn FieldName="代码" ReadOnly="True" VisibleIndex="0" Width="80px">
<editcellstyle horizontalalign="Center">
</editcellstyle>
<DataItemTemplate>
<asp:Label id="Label4" runat="server" Text='<%# Eval("代码") %>' Width="50px" />
</DataItemTemplate>
<EditItemTemplate>
<asp:Label id="Label1" runat="server" Text='<%# Eval("代码") %>' Width="50px" />
</EditItemTemplate>
<cellstyle horizontalalign="Center">
</cellstyle>
</dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn FieldName="名称" ReadOnly="True" VisibleIndex="1" Width="80px">
<editcellstyle horizontalalign="Center">
</editcellstyle>
<DataItemTemplate>
<asp:Label id="Label2" runat="server" Text='<%# Eval("名称") %>' />
</DataItemTemplate>
<EditItemTemplate>
<asp:Label id="Label3" runat="server" Text='<%# Eval("名称") %>' />
</EditItemTemplate>
<cellstyle horizontalalign="Center">
</cellstyle>
</dx:GridViewDataTextColumn>
<dx:GridViewDataCheckColumn FieldName="是否允许发货" VisibleIndex="2" Width="50px">
<editcellstyle horizontalalign="Center" verticalalign="Middle" wrap="True">
</editcellstyle>
<editformcaptionstyle horizontalalign="Center">
</editformcaptionstyle>
<EditItemTemplate>
<dx:ASPxCheckBox ID="edits" runat="server" ClientInstanceName="edit" Checked='<%# Eval("是否允许发货") %>' >
<clientsideevents checkedchanged="function(s, e) {
grid1.UpdateEdit();
}" />          /dx:ASPxCheckBox>
</EditItemTemplate> <cellstyle horizontalalign="Center" verticalalign="Middle" wrap="True">
</cellstyle>
</dx:GridViewDataCheckColumn>
</Columns>
<settingsbehavior allowselectbyrowclick="True" />
<settingspager pagesize="20">
</settingspager>
<settingsediting mode="Inline" />
</dx:ASPxGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:cobosdConnectionString %>" DeleteCommand="DELETE FROM [xs_办事处档案] WHERE [代码] = @original_代码" InsertCommand="INSERT INTO [xs_办事处档案] ([代码], [名称], [是否允许发货]) VALUES (@代码, @名称, @是否允许发货)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [代码], [名称], [是否允许发货] FROM [xs_办事处档案]" UpdateCommand="UPDATE [xs_办事处档案] SET [名称] = @名称, [是否允许发货] = @是否允许发货 WHERE [代码] = @original_代码">
<DeleteParameters>
<asp:Parameter Name="original_代码" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="代码" Type="String" />
<asp:Parameter Name="名称" Type="String" />
<asp:Parameter Name="是否允许发货" Type="Boolean" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="名称" Type="String" />
<asp:Parameter Name="是否允许发货" Type="Boolean" />
<asp:Parameter Name="original_代码" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxGridView;
namespace ERP.Web.Finance.Agent
{
public partial class IsAllowDelivery : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } protected void ASPxButton1_Click(object sender, EventArgs e)
{
ASPxGridView1.UpdateEdit();
} protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{ ASPxGridView1.UpdateEdit();
} protected void edit_CheckedChanged(object sender, EventArgs e)
{ } protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
{ ASPxCheckBox ck = (ASPxCheckBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["是否允许发货"], "edits");
e.NewValues["是否允许发货"] = ck.Checked;
}
}
}

aspxgridview只编辑某一列然后更新的更多相关文章

  1. Extjs之rowEditing编辑状态时列不对齐

    Extjs在使用rowEditing的时候,会在每一列加上editor属性,表示当处于编辑状态时这一列的值是什么类型的,后突然发现在rowEditing处于编辑状态时每一列的宽度边框了,如果列数非常多 ...

  2. SQLServer数据库自增长标识列的更新修改操作

    SQLServer数据库自增长标识列的更新修改操作方法在日常的sql server开发中,经常会用到Identity类型的标识列作为一个表结构的自增长编号.比如文章编号.记录序号等等.自增长的标识列的 ...

  3. sqlalchemy如何实现时间列自动更新?

    目标:数据表的时间列在其他列内容更新的时候,自动更新时间列到更新的时间 方法:数据库表模型如下:server_default表示初始时间,onupdate表示更新的时间 class MonitorDa ...

  4. MFC编辑框接收数据动态更新与刷新方法代码示例-如何让编辑框内容实时更新

    MFC编辑框接收数据动态更新与刷新方法代码示例-如何让编辑框内容实时更新 关键代码: //发送数据通知 //from txwtech@163.com LRESULT CCommSampleDlg::O ...

  5. 使用Vue-TreeSelect组件的时候,用watch变量方式解决弹出编辑对话框界面无法触发更新的问题

    在前篇随笔<使用Vue-TreeSelect组件实现公司-部门-人员级联下拉列表的处理>中介绍了Vue-TreeSelect组件的使用,包括使用v-modal绑定值,normalizer ...

  6. EasyUI/TopJUI可编辑表格的列根据返回数据判断是使用 combobox 还是 numberbox

    这两天研究了一下topjui的可编辑表格edatagrid,想在每一列的后面根据返回的数据判断是使用 combobox 还是 numberbox,期间遇到了一些坑,下面实现代码,需要的朋友可以参考一下 ...

  7. [Oracle] 生产上表的列类型更新

    由于粗心,数据库脚本生成的时候错将一个类型NUMBER(5)的字段类型改为 VARCHAR2(5) 直接进行表修改会报错,因为数据已经存在,不能进行更新: ); 大体思路如下:       将要更改类 ...

  8. SQL语句的Select部分只写必要的列

    如果Select部分包含不需要的列,这会强制DB2必须进入数据页来得到所请求的特定列,这就要求更多的I/O操作.另外,如果再对这个不需要的列进行排序,就需要创建和传递一个更大的排序文件,相应地会使排序 ...

  9. Pandas(python)数据处理:只对某一列DataFrame数据进行归一化

    处理数据要用到Pandas,但是没有学过,不知道是否有直接对某一列归一化的方法调用.自己倒弄了下.感觉还是比较麻烦. 使用Pandas读取到数组之后想把其中的'MonthlyIncome'一列进行归一 ...

随机推荐

  1. CSS-posiziton

    1. 想要实现,”返回顶部”永远位于页面的右下角.需要用到position函数.CSS:层叠样式表.用到了分层的功能. position:fixed;  永远固定在一个地方. <!DOCTYPE ...

  2. [洛谷P3627][APIO2009]抢掠计划

    题目大意:给你一张$n(n\leqslant5\times10^5)$个点$m(m\leqslant5\times10^5)$条边的有向图,有点权,给你起点和一些可能的终点.问从起点开始,到任意一个终 ...

  3. Educational Codeforces Round 40 F. Runner's Problem

    Educational Codeforces Round 40 F. Runner's Problem 题意: 给一个$ 3 * m \(的矩阵,问从\)(2,1)$ 出发 走到 \((2,m)\) ...

  4. bzoj1057: [ZJOI2007]棋盘制作(悬线法)

    题目要求纵横坐标和奇偶性不同的点取值不同,于是我们把纵横坐标和奇偶性为1的点和0的点分别取反,就变成经典的最大全1子矩阵问题了,用悬线法解决. #include<iostream> #in ...

  5. selenium - webdriver - Keys类(键盘操作)

    Keys()类提供了键盘上几乎所有按键的方法,这个类可用来模拟键盘上的按键,包括各种组合键,如 Ctrl+A, Ctrl+X,Ctrl+C, Ctrl+V 等等 from selenium impor ...

  6. To pack or not to pack – MyISAM Key compression

    MyISAM storage engine has key compression which makes its indexes much smaller, allowing better fit ...

  7. Fixed: The Windows Process Activation Service service terminated with the following error: The system cannot find the file specified

    I'm not yet clear what I did, but I'm blogging it so it can be found if someone else has this issue. ...

  8. [技巧篇]05.关于eclipse模版

    <?xml version="1.0" encoding="UTF-8" standalone="no"?><templa ...

  9. [hdu2460]network(依次连边并询问图中割边数量) tarjan边双联通分量+lca

    题意: 给定一个n个点m条边的无向图,q个操作,每个操作给(x,y)连边并询问此时图中的割边有多少条.(连上的边会一直存在) n<=1e5,m<=2*10^5,q<=1e3,多组数据 ...

  10. 【HDU】6012 Lotus and Horticulture (BC#91 T2)

    [算法]离散化 [题解] 答案一定存在于区间的左右端点.与区间左右端点距离0.5的点上 于是把所有坐标扩大一倍,排序(即离散化). 让某个点的前缀和表示该点的答案. 初始sum=∑c[i] 在l[i] ...