51aspx gridview ajax,ASPxGridView1用法<->

后台帮定代码:using System;

using System.Collections.Generic;

using System.Linq;using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

public partial class Default2 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

Datagrid();

}

private void Datagrid()

{      DataTable data = DB.FillDataTable_Pro("select  top 40 * from bi_t_item_info");           this.ASPxGridView1.DataSource = data;

this.ASPxGridView1.DataBind();

}

//***事件

protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)

DB.ExecuteScalar(string.Format("delete bi_t_item_info where item_no='{0}'", str));       e.Cancel = true;

Datagrid();

}

}

前台代码:

OnDataBound="ASPxGridView1_DataBound"

KeyFieldName="item_no"

>

ReadOnly="true">

ReadOnly="true">

ReadOnly="true">

ReadOnly="false">

VisibleIndex="4" ReadOnly="false">

VisibleIndex="4" ReadOnly="false">

要注意的是,有红色标示地方,此处必须是主键,我就是因为这个地方没有邦定主键,***事件不执行,查了好久才查出来!

对于ASPxGridView***按钮的确认弹出框,只需要简单设置几个属性即可。

1.首先自然要先启用行的***功能。

2.然后设置ASPxGridView的SettingsBehavior的ConfirmDelete属性为Ture,即启用***功能的确认框。

3.设置弹出框内容文本。在ASPxGridView的SettingsText中设置ConfirmDelete属性为”确定要***吗?”即可。

几个常用属性IsEditing         :是否处于编辑状态IsNewRowEditing   :是否是新建行的编辑状态

GridLines="Vertical"            :网格样式Vertical, Both, None

ShowGroupPanel="True"           :分组面板ShowFooter="True"               :脚注面板ShowFilterRow="True"            :过滤器行ShowHeaderFilterButton="true"   :表头过滤按钮ShowGroupFooter="VisibleAlways" :分组脚注面板Hidden | VisibleIfExpand | VisibleAlways

ShowPreview="true"              :预览面板ShowVerticalScrollBar="True"    :垂直滚动条VerticalScrollableHeight="250"  :垂直滚动条SettingsBehaviorAllowDragDrop="False"           :允许托拽ColumnResizeMode="Control"      :列宽度调整模式AllowFocusedRow="True"          :鼠标点击选择行PageSize="30"                   :分页大小Mode="ShowAllRecords"           :展示模式SEOFriendly="Enabled"           : Search engine friendly

Position="TopAndBottom"         :分页控件位置SettingsText

Title="标题"

EmptyDataRow="无数据"

3e3cb22f9d3a3dd6bab751ad4297ba6e.png

PopupEditFormCaption="编辑"ConfirmDelete="确定***?"

编辑模式SettingsEditing.Mode

EditForm               :当前行转化为表单,嵌入在行中EditFormAndDisplayRow  :同EditForm,但保留当前行Inline                 :在当前行现场编辑PopupEditForm          :弹出窗口编辑

几个常用方法获取单元格的值decimal change = (decimal)grid.GetRowValues(e.VisibleIndex, "Change");获取模板中的控件Label label = grid.FindRowCellTemplateControl(e.VisibleIndex, null, "changePercent") as Label;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值