databound

ASPxGridView1用法<->

不羁岁月 提交于 2020-12-31 09:23:12
后台帮定代码: 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

After every postback dropdownlist items repeats

半城伤御伤魂 提交于 2020-01-05 14:59:40
问题 I have bind my dropdownlist with database. But on each PostBack the items in dropdownlist gets repeat again. e.g. OnPage Load I have this items in dropdownlist 1,2,3,4.. etc Now suppose page gets postBack then it looks like 1,2,3,4,1,2,3,4 Vb code Private Sub hospitals_Load(sender As Object, e As EventArgs) Handles Me.Load Me.PopulateAreas() End Sub Private Sub PopulateAreas() If IsPostBack Then Dim citySelector As DropDownList = Page.Master.FindControl("locationSelector") Using conn As New

After every postback dropdownlist items repeats

不打扰是莪最后的温柔 提交于 2020-01-05 14:59:16
问题 I have bind my dropdownlist with database. But on each PostBack the items in dropdownlist gets repeat again. e.g. OnPage Load I have this items in dropdownlist 1,2,3,4.. etc Now suppose page gets postBack then it looks like 1,2,3,4,1,2,3,4 Vb code Private Sub hospitals_Load(sender As Object, e As EventArgs) Handles Me.Load Me.PopulateAreas() End Sub Private Sub PopulateAreas() If IsPostBack Then Dim citySelector As DropDownList = Page.Master.FindControl("locationSelector") Using conn As New

Selecting item in databound combobox

萝らか妹 提交于 2019-12-25 06:42:20
问题 I believe this question is kinda new-bie, but I can't solve it in correct way. Brief description: I have an inherited from ComboBox class that does some data bindings in constructor: var mdl = new Model(); ValueMember = "id"; DisplayMember = "unit"; DataSource = mdl.getUnits(); All good here. The combobox is filled by required data. Then I have another form with a function editIngridient. The function is following; public bool editIngridient(int id) { currentId = id; var row = mdl

How to access the bound DataSource item in the ASP.NET ListView's DataBound event?

拥有回忆 提交于 2019-12-25 01:47:21
问题 I know the question has already been posted here but we didn't get to an real solution. I have bound my ListView to an SqlDataSource and I want to write some text in a control present in the view created in the LayoutTemplate depending on some properties of the rows returned. Obviously, I'm using the ItemDataBound event to feed my items but this is not the point. The spontaneous solution was to bind the ListView.DataBound event and access the raw datasource (a DataTable?) and do the required

Disable separator selection in data bound combo box in WPF

本秂侑毒 提交于 2019-12-22 13:59:57
问题 I have a Combo Box that is databound. In this list, I need a separator. Since this is databound, I do something very similar to this post. My database returns the list, includes a '-' to mark where the separator needs to go, and the datatrigger makes this a separator. <ComboBox Name="cbAction" Grid.Column="1" Grid.Row="0" Margin="5,2,5,2" DisplayMemberPath="Description" SelectedValuePath="Code" SelectionChanged="cbAction_SelectionChanged"> <ComboBox.ItemContainerStyle> <Style TargetType="{x

asp repeater databound

帅比萌擦擦* 提交于 2019-12-13 03:05:35
问题 I guys, isn't present databound event on asp repeater server control? I just want to bind all my data, and at the end creates a new ItemTemplate and add it, but just when is all data binded 回答1: I use this for calculating total hours in the collection. Even though I put it into the FooterTemplate , you should be able to get the point. <asp:Repeater ID="rptRecords" runat="server" OnItemDataBound="rptRecords_ItemDataBound"> protected void rptRecords_ItemDataBound(object sender,

Custom BoundField doesn't preserve data between PostBacks with added LiteralControl

北慕城南 提交于 2019-12-12 04:37:58
问题 I've created a custom BoundField for use with a DetailsView in Edit and Insert modes to utilize Twitter Bootstrap. The control works fine, except when I add in extra LiteralControl s to surround the TextBox with some HTML during InitializeDataCell(...) . Code related to this toward the end. The HTML generated is below seems to be identical to what is generated with a TemplateField . But when I fire an Update , anytime it adds the extra div / span seen here, the value in the TextBox is blank

C# - Setting up data-bound cascading combo boxes at design time

穿精又带淫゛_ 提交于 2019-12-10 17:53:44
问题 I have what I thought would be a simple problem but cannot find an appropriate example after much searching. Put simply, it is a windows form application with 2 databound combo boxes on the form with the first being for "Department" and the second for "Section". These combos are each bound to the corresponding tables in a SQL database. The combos should operate with the user selecting Department from the first which causes the second combo to be filtered to show only sections belonging to

How to dynamically refresh a .NET databound repeater control

不问归期 提交于 2019-12-07 01:10:27
问题 I have a .NET repeater control that is data-bound to a List. As part of the Repeater's Item Collection , I have a "Remove Button" that effectively removes this current List element. This works, in code-behind I can successfully remove an item from the datasource of the Repeater . My problem is this : when I reset the updated datasource and call MyRepeater.DataBind() again, the Repeater interface does not refresh with the Item removed. I am looking for the event to essentially redraw or