databound-controls

How can I access the parent datasource in data expression syntax in Asp.net?

I have a Repeater inside the TemplateField for a GridView. GridView is bound to datasource1 and the repeater to datasource2. How can i access datasource1 from the ItemTemplate of repeater in data binding syntax (<%# %>) of repeater itemtemplate? ...

Skipping Items During Data Binding

Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id="myFormView" runat="server" DataSourceID="myXmlDataSource"> <ItemTemplate> <span>Items</span> <asp:Repeater id="myRepeater1" runat="server" DataSource='<%# XPathSelect("Items/*")%>'> <HeaderTemplate> <ul> ...

ASP.NET: Bind Repeater using JQuery?

I have a Repeater control that I bind server-side. It repeats a series of divs, and does so with no problem. I have some buttons that I use to sort the repeater (newest, highest ranked, random) and this works the way it should. I would like to improve my user experience by making the buttons sort the divs using ajax/jquery somehow so t...

How can I get a bound control's client ID with javascript and/or server-side tags?

<asp:DataGrid> <ItemTemplate> 1) <asp:TextBox ID="tbComments" onChange="javascript:checkLength(<%# tbComments.ClientId %>);" runat="server"/> 2) <span id="<%# tbComments.ClientId %>Label"></span> </ItemTemplate> </asp:DataGrid> Any ideas to make the above working (which doesn't :P)? ...

How do I create a nested GridView bound to parent's EntityDataSource's navigation property?

<asp:FormView DataSourceId="edsAccounts"> <ItemTemplate> <asp:TextBox Text='<%# Eval("Email") %>' /> <asp:DataGrid ID="dgReports" DataSource='<%# Eval("Reports") %>'> </ItemTemplate> </asp:FormView> <asp:EntityDataSource ID="edsAccounts" runat="server" ConnectionString="name=Entities" DefaultContainerName="Entitie...

Data Grid DataFormatString formatting not working

I came accross an issue a few days ago which I'd completely forgotten about, and noticed it wasn't mentioned on SO. In an ASP.Net document, a datagrid was created dynamically as part of a business intellgience tool. The data format string was being set in the code behind, but was not being shown correctly on the rendered page. As it t...

How to get parent GridView's data-bound value

<asp:GridView DataSource="Reports"> <ItemTemplate> <asp:TextBox Text='<%# Bind("ReportId") %>' <asp:Repeater DataSource="Something that is different than the GridView's DS"> <a href='<%# Bind("ReportId", "reports.aspx?report={0}") %>'/> </asp:Repeater> </ItemTemplate> </asp:GridView> I know t...

Is there a way to bind textboxes in a webform so the data is save as the user types in?

Hello! I have in my webform many TBs bound to a property in the code behind: <asp:TextBox ID="tbFirstName" Text="<%# Contact.FirstName %>" runat="server" /> <script language="c#"> public Contact Contact { get { return (Contact)ViewState["Contact"]; } } </script> <script language="VB"> ...

WPF - Unable to clear items from a databound itemscontrol

Hi, I've created a combobox and have bound it to an observableCollection. Something like myCmbBox.ItemsSource = myObsCollObj My scenario is onLoad of the application I shall populate my observableCollection with some values. Now, my UI also gets refreshed with those values automatically. If the user selects a different value from ano...

Extending a (ASP.NET) BoundField

I would like to create a control that extends the BoundField that's used within a GridView. What I'd like to do is provide another property named HighlightField that will be similar to the DataField property in that I want to give it the name a data column. Given that data column it would see if the value is true or false and highlight...

Overriding how Data is bound to Controls in a GridView

I'm not having much luck so far, so I am going to generalize my problem to see if there is a better way to accomplish what I neeed. Here is my scenario - I want a control that is defined in an aspx very similarly to a gridview. Something like this: <user:ReportView runat="server" id="rvData" > <Columns> <asp:BoundField Head...

ASP.NET - Ideal Control to Display a Pivot Table

I am trying to display a tabular set of data in a databound control, but I need to pivot the table such that the individual records are table columns rather than table rows. The end result is a table with a fixed number of columns and a variable number of rows each displaying single field for all of the records like this. Due to the fact...

Is there a way to save databound ListView data as a whole instead of saving per row?

I have a ListView that is databound thru DataSource of type typed dataset table. private void LoadTrusts(int? clientId, int? imageId) { TrustDataSource = GetTrusts(clientId, imageId); _TrustListView.DataSource = TrustDataSource; _TrustListView.DataBind(); } Where TrustDataSource is saved to ViewStat...

How to handle two-way binding of a SqlDataSource on a ASP.NET ListBox

If I have two listboxes, with a button between them, how do I update the Items of ListBox2 if ListBox2's items are databound? <asp:ListBox runat="server" ID="ListBox1" DataSourceID="DataSource1" DataTextField="Name" DataValueField="ID" SelectionMode="Multiple" /> <asp:Button runat="server" ID="addButton" onClick="addButton_Click" ...

Data Bound listbox selectedindex always -1

I've got a simple upload form. Here's my code: <form id="Form1" method="post" enctype="multipart/form-data" runat="server" <asp:label id="lblMsg" runat="server" CssClass="msg" /> <span class="msg">Select Gallery:</span> <asp:listbox id="gallerySelect" runat="server" Rows="1" DataTextField="galleryName" DataValueField="galler...

Dynamic controls in databound control

I have a control that inherits CompositeDataBoundControl. Based on the values of the bound data, I create som dynamic controls. In order to preserve state, I need to recreate the control tree on every request(from CreateChildControls): if(dataSource != null) { IEnumerator e = dataSource.GetEnumerator(); if(e != null) { ...

HierarchicalDataBoundControl.PerformDataBinding not being called on postback.

The title says it all. I am binding to a SiteMapDataSource (hierarchical). I am overriding PerformDataBinding to grab the data from the datasource. Everything works great on page load. But when I perform a postback anywhere on the page, the PerformDataBinding method does not get called, and in effect, not rendering any menu items (Per...

Which Control can is equvalent to databound list combox box of vb6 in vb.net windows form application

Hi guys, I think there should a control like databound list control of vb6 in vb.net windows form application too which can show up data from database. I have confused and staring my database applications in vb.net.... so can you suggest which control can be used? ...

Designer problem with CompositeDataBoundControl

I have a custom class: SimpleTemplatedControl : CompositeDataBoundControl private ITemplate _itemTemplate; [PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(typeof(SimpleItem)), ] public ITemplate ItemTemplate { get { return _itemTemplate; }// get set { _itemTemplate = value; }/...

Help creating a Template control in ASP.NET

Hi all - I've never created a template control before in ASP.NET, so I'm trying to stumble my way through it! Basically, my template control looks like this: <%@ Control Language="C#" CodeFile="MyControl.ascx.cs" Inherits="Controls_MyControl" %> <h2><%= Heading %></h2> <div id="hide" runat="server"> </div> <div id="show" runat="server...