<%@ 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. bzoj 1862: [Zjoi2006]GameZ游戏排名系统 & bzoj 1056: [HAOI2008]排名系统

    傻叉了一晚上,把t打成x,然后这题神奇在于输出一段数,不足的不用输出,一开始我的是直接找没有后面就退,然后这样会格式错误囧……然后最后zj的还卡了下空间,于是不用string就过了……string毁一 ...

  2. [CQOI2017]老C的方块 网络流

    ---题面--- 题解: 做这题做了好久,,,换了4种建图QAQ 首先我们观察弃疗的形状,可以发现有一个特点,那就是都以一个固定不变的特殊边为中心的,如果我们将特殊边两边的方块分别称为s块和t块, 那 ...

  3. POJ2945:Find the Clones——题解

    http://poj.org/problem?id=2945 还是trie树……对于结束标记累加并且开个数组记录一下即可. #include<cstdio> #include<cst ...

  4. 实验五 TCP传输及加解密

    北京电子科技学院(BESTI) 实     验    报     告 课程:Java程序设计                         班级:1353            姓名:陈巧然     ...

  5. Codeforces Round #514 (Div. 2) C. Sequence Transformation(递归)

    C. Sequence Transformation 题目链接:https://codeforces.com/contest/1059/problem/C 题意: 现在有1~n共n个数,然后执行下面操 ...

  6. 在IAR使用FreeRTOS出现Error[Pa045]: function "XXX" has no prototype

    FreeRTOS官方例程中设置了需要“Require prototype”,所以每个函数(除了main函数)都需要函数声明,其中对于无形参的函数声明要加void,比如void led_init(voi ...

  7. 数据分析侠A的成长故事

    数据分析侠A的成长故事 面包君  同学A:22岁,男,大四准备实习,计算机专业,迷茫期 作为一个很普通的即将迈入职场的他来说,看到周边的同学都找了技术开发的岗位,顿觉自己很迷茫,因为自己不是那么喜欢钻 ...

  8. python 栈和队列

    class Stack: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def push ...

  9. 解决Sublime Install Package的There are no packages available for install问题(channel_v3.json)

    Sublime版本 Sublime Text 3.1.1 Build 3176 自己也尝试了很多次,所以这一解决办法仅是可能解决你的问题 一.解决简要描述 造成的原因大致是 无法通过request去获 ...

  10. 51Nod 1024 矩阵中不重复的元素 | 技巧 数学

    first try: set<LL> sset; int main() { LL m,n,a,b; while(~scanf("%lld%lld%lld%lld",&a ...