天道酬勤,学无止境

aspxgridview

GridView 中的 TextBox 在回发时不保持其值(TextBox in GridView not holding its value on postback)

问题 我在 .NET 表单应用程序上有一个 gridview,在回发时,我没有看到在 gridview 的文本框中输入的值。 ASPX: <asp:GridView ID="gvItems" runat="server" AutoGenerateColumns="false" ShowHeader="false" DataKeyNames="ItemId" EnableViewState="true"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="txtItem" runat="server" Text="0" EnableViewState="true" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="ItemId" /> </Columns> </asp:GridView> <asp:Button runat="server" ID="btn" Text="Submit" OnClick="btn_OnClick" OnClientClick="javascript:return someClientStuff();" /> 背后的代码: protected void btn_OnClick(object

2021-09-15 01:31:13    分类:技术分享    c#   asp.net   .net   gridview   aspxgridview

TextBox in GridView not holding its value on postback

I have a gridview on a .NET forms application, and on postback, I am not seeing the values entered in the textbox within a gridview. ASPX: <asp:GridView ID="gvItems" runat="server" AutoGenerateColumns="false" ShowHeader="false" DataKeyNames="ItemId" EnableViewState="true"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="txtItem" runat="server" Text="0" EnableViewState="true" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="ItemId" /> </Columns> </asp:GridView> <asp:Button runat="server" ID="btn" Text="Submit" OnClick="btn_OnClick" OnClientClick="javascript

2021-09-07 16:43:25    分类:问答    c#   asp.net   .net   gridview   aspxgridview

Insert/Update/Delete is disabled for this control. message of EntityDataSource

I use ASPxGridView and EntityDataSource as its datasource. In EntityDataSource, I write CommandText, so I can not set "EnableInsert", "EnableUpdate", or "EnableDelete" to true. That's why, I manipulate (insert, update, delete) data manually. Changes are made manually pass through to database. But at the side of the GridView these errors are given: For inserting: "Insert is disabled for this control." For updating: "Update is disabled for this control." For deleting: "Delete is disabled for this control." How can I solve this problem? (The reason of using CommandText is where parameters and

2021-09-04 18:45:09    分类:问答    asp.net   devexpress   aspxgridview   entitydatasource

Calculate GroupSummary Value programmatically in DevExpress

In my code; I calculate 3 GroupSummary value with ASPxGridview; <dx:ASPxSummaryItem FieldName="RISK_EUR" SummaryType="SUM" ShowInGroupFooterColumn="RISK_EUR" DisplayFormat="n0" /> <dx:ASPxSummaryItem FieldName="IPOTEK" SummaryType="AVERAGE" ShowInGroupFooterColumn="IPOTEK" DisplayFormat="n0" /> <dx:ASPxSummaryItem FieldName="MV_BERND" SummaryType="SUM" ShowInGroupFooterColumn="MV_BERND" DisplayFormat="n0" /> When i grouping, I want calculate another column's GroupSummary value like; GroupSummary[RISK_EUR] - GroupSummary[IPOTEK] - GroupSummary[MV_BERND] How? NOTE: I can't calculate this value

2021-09-01 14:57:52    分类:问答    c#   .net   asp.net   devexpress   aspxgridview

ObjectDataSource 中的 DevExpress AspxGridView 过滤器(DevExpress AspxGridView filter in ObjectDataSource)

问题 DevExpress AspxGridView 的另一个问题:) 上下文: 一页在 Page 中,自定义控件在自定义控件中,一个 AspxDropDown AspxDropDown有一个DropDownWindowTemplate 在DropDownItemTemplate ,我添加了一个GridView和一个启用分页/排序/过滤的ObjectDataSource 在处理ObjectDataSource的选择事件时,我应该为数据源设置过滤器参数。 过滤器参数应该来自FilterRow的AspxGridView (最好使用AspxGridView.FilterExpression属性)。 问题: AspxGridView.FilterExpression属性未设置为正确的值(由用户设置)。 有没有人找到我在这里尝试做的事情的一个很好的实现? 谢谢一堆。 :) 回答1 我终于设法解决了这个问题。 不是一个好的解决方案,但仍然是一种解决方法。 所以..“解决方案”是在每个 AfterPerformCallback 事件上对网格进行数据绑定。 void grid_AfterPerformCallback(object sender, ASPxGridViewAfterPerformCallbackEventArgs e) { ((DevExpress.Web.ASPxGridView

2021-09-01 00:06:14    分类:技术分享    asp.net   filtering   devexpress   objectdatasource   aspxgridview

devexpress 行删除事件(devexpress row deleting event)

问题 Deletebutton 不会引发 OnRowDeleting 事件 我在运行时创建了 devexpress gridview,它运行良好,直到单击删除按钮,当我单击它时,它不起作用。在调试时它不会触发“rowdeleting”。 我能做什么? dovizgrd.Width = Unit.Percentage(50); dovizgrd.EnableCallBacks = false; dovizgrd.Settings.ShowFooter = false; dovizgrd.Settings.ShowColumnHeaders = false; dovizgrd.Settings.ShowFilterBar = GridViewStatusBarMode.Hidden; dovizgrd.SettingsPager.Visible = true; dovizgrd.SettingsPager.Mode = GridViewPagerMode.ShowPager; dovizgrd.Styles.Header.Wrap = DevExpress.Utils.DefaultBoolean.True; dovizgrd.SettingsPager.PageSize = 10; DevExpress.Web.ASPxGridView.GridViewCommandColumn

2021-08-31 13:41:54    分类:技术分享    c#   asp.net   devexpress   aspxgridview

在 TemplateField 中用 Headertemplate 替换 HeaderText(Replacing HeaderText with Headertemplate in TemplateField)

问题 我有一个带有模板字段列的网格视图。 TemplateFields 是这样的: <asp:TemplateField HeaderText="Title" SortExpression="name" meta:resourcekey="BoundFieldResource1"> <ItemTemplate> <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Name") %>' meta:resourcekey="BoundFieldResource1"></asp:Label> </ItemTemplate> 我必须为此列的标题添加一个自定义属性,因此我删除了 HeaderText 并添加了以下内容: <Headertemplate> <asp:Label ID="lblTitleHeading" runat="server" Text="Title" data-custom="tbl-th_title_heading"></asp:Label> </Headertemplate> 我的问题是,当我这样做时,它会破坏该列的排序,我无法再单击标题对其进行排序,我尝试将其更改为,但没有做任何事情。 我会很感激你的回答。 回答1 好的,我刚刚发现了如何做到这一点,我只需要将标签更改为 LinkBut​​ton 并添加

2021-08-31 02:05:56    分类:技术分享    sorting   webforms   custom-attributes   aspxgridview   templatefield

devexpress row deleting event

Deletebutton doesn't raise OnRowDeleting event i created devexpress gridview on runtime it s working good until click the delete button ,when i click it ,it doesn't work .on debug it doesnt fire "rowdeleting". What can i do? dovizgrd.Width = Unit.Percentage(50); dovizgrd.EnableCallBacks = false; dovizgrd.Settings.ShowFooter = false; dovizgrd.Settings.ShowColumnHeaders = false; dovizgrd.Settings.ShowFilterBar = GridViewStatusBarMode.Hidden; dovizgrd.SettingsPager.Visible = true; dovizgrd.SettingsPager.Mode = GridViewPagerMode.ShowPager; dovizgrd.Styles.Header.Wrap = DevExpress.Utils

2021-08-30 21:19:55    分类:问答    c#   asp.net   devexpress   aspxgridview

如何获取所选行 Devexpress GridView 的字段值?(How to get field value of selected Row Devexpress GridView?)

问题 我使用 DevexpressGridView 来显示所有TOPIC (id,title,content) <dx:ASPxGridView ID="gv" runat="server" OnSelectionChanged="gv_SelectionChanged" > 我有 grid_SelectionChanged 事件: protected void gv_SelectionChanged(object sender, EventArgs e) { int id= selected row...???; //how can I get the value of selected row string sql = "select * from TOPIC where idTOPIC="+id; DataTable topic = l.EXECUTEQUERYSQL(sql); TextBox1.Text = topic.Rows[0][1].ToString(); } ... gv.SelectedRow似乎不存在gv.SelectedRow方法。 按照建议,我尝试过FocusedRowIndex方法,但我真的不知道获取所选行值的正确语法。 帮助!!! 回答1 更改选择与更改焦点行不同。 有关两者之间的区别,请参阅 Selection 的文档。 您可以使用 gv

2021-08-12 01:56:24    分类:技术分享    c#   asp.net   devexpress   aspxgridview

How to programmatically reach any AspxControl inside an AspXGridView's EditItemTemplate

Its very simple and i feel myself as an idiot :( I newly started to using DevX Controls. Its documentation and sample projects are SUCKS! My problem is: I have an ASPxGridView on my aspx page: <dx:ASPxGridView ID="dxdgMyGrid" runat="server" AutoGenerateColumns="False" OnStartRowEditing="DxGridStartRowEditing"> <SettingsEditing Mode="PopupEditForm" PopupEditFormHeight="200px" PopupEditFormWidth="500px" EditFormColumnCount="2" PopupEditFormHorizontalAlign="Center" PopupEditFormVerticalAlign="Middle" PopupEditFormModal="true" /> <Columns> <dx:GridViewDataTextColumn FieldName="MyField1"

2021-08-10 18:09:12    分类:问答    asp.net   devexpress   aspxgridview   edititemtemplate