databound

How to programmatically insert a row in a GridView?

i have a databound GridView in asp.net 2.0 with a row-selection link. When a row is selected, I want to programmatically add a table row below the selected row, in order to nest another grid et al. I am researching this for a client and for an article, and i think my google-fu is not strong tonight. Any suggestions? EDIT: I actually ha...

ASP.Net Form Databound problems

I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great. I have an ImageButton controlwhich has an OnClick Event set to grab all of the data from the form. Unfortunately, when I click the butt...

WPF ListBox Can you make it cycle? IE not hit hard stops at top and bottom

I have a WPF ListBox bound to a data object. Inside the listbox are a series of images with text. It is layed out in a horizontal fashion, and mousing over the left or right sides of the box scroll the items left or right respectively. let's say there are 20 items in the listbox. I'm trying to figure out how when I hit position 19 item ...

DataBound WPF ListBox Styling on ListBoxItems

I have a listbox that during development I had the items in the list box hardcoded and styled. This is how the items were styled. <ComboBoxItem Width="Auto" Height="Auto" Content="ComboBoxItem" > <ComboBoxItem.Foreground> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"...

How to dynamically refresh a .NET databound repeater control

I have a .NET repeater control that is data-bound to a List. As part of the Repeater's ItemCollection, 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 ...

ninject Linfu databound proxy object.

I have the following scenario. I have a ViewModel object (It's just a regular object, that impliments INotifyPropertyChanged). I'm binding this object to a view, written in WPF. When I bind it it works fine, events fire, and things are updated, perfect!!! Now I've tried to introduce some validation into the object, I'm checking argum...

ASP.NET: An editable data bound control in every record?

We need to display the result of an SQL SELECT statement on a ASP.NET 3.5 web page. Although there are a number of columns that need to be displayed, only one of the columns needs an editable text box in it... however every record in the result set needs this editable textbox. I know I can do this manually by building an html table myse...

Data bound radio button list in WPF

So I have a list of options in a data object, and I want to make the equivalent of a radio button list to allow the user to select one and only one of them. Functionality similar to a databound combo box, but in radio button format. Silly me, I thought this would be built in, but no. How do you do it? ...

Making multiple copies of a data bound object from a DataGridView - how to decouple them?

I have a DataGridView object to which I've bound a list of objects (of type Asset) returned from a database query. I'm programming in VB using Visual Studio 2005. I want to grab two copies of the bound object (calling them oldAsset and newAsset) from the selected row in the DataGridView, update newAsset based on input from other contro...

WPF Creating a ControlTemplate that is DataBound

I have a control bound to an Object and all is well but I want to turn it into a control template bound to different objects of a similar type. I would like to do this exclusively in xaml, if possible. Any good tutorials that outline the steps? <TextBlock Text="{Binding Source={StaticResource BorderControl}, Path=ControlName}"/> EDI...

Equivalence of an asp:HiddenField for a GridView

There is no asp:HiddenField that can be used in a GridView so I was wondering what would work similar to this. My reasoning for wanting this is I have a ButtonField that triggers an OnRowCommand. From there I can figure out which row was selected, but I cannot retrieve the text value from the ButtonField to see the data that was bound t...

How can I replace characters from a databound object?

I have this: <img id="imgField" alt="" runat="server" src='<%# string.Format("images/{0}.jpg", DataBinder.Eval(Container.DataItem,"Name")) %>' /> and it's rendering %20's from the spaces in the databound Name. So I need to replace all of the "%20's" with "" I tried <img id="imgField" alt="" runat="server" src='<%# string.Format("ima...

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"> ...

How do I find the Client ID of control within an ASP.NET GridView?

I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like to obtain it's ID for use in javascript. Something like this: <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="textDateSent" runat="server" /> <input type="button" value='Today' onclick="setToday('<%# textDateSent....

Anonymous type in Repeater DataBound event

Hi All I'm setting the DataSource of an ASP.NET repeater as follows: rptTargets.DataSource = from t in DB.SalesTargets select new { t.Target, t.SalesRep.RepName }; Now, in the repeater's OnDataBound event, how can I retrieve the RepName and Target properties from the anonymous type contained in e.Item.DataItem? Many Thanks ...

Unselect Databound Combobox Winforms .NET

The problem: combobox is databound to a DataView, first item in the dataview is DataRowView whose fields are DBNull.Value; Combo DropdownStyle = ComboBoxStyle.DropDownList Loads fine, displays fine, selects fine, problem is to Unselect via code. Setting the SelectedIndex to 0 throws an exception. (Setting to -1 is a no-no as per msdn do...

Insert new item to ListView after first item

I am trying to add a new item in a ListView on itemdatabound. What is the best way to do it? Data comes from a dataset with TopicReplyListView.DataSource = TopicReplyDataTable; TopicReplyListView.DataBind(); on TopicReply_ItemDataBoundEvent I want to add text such as "TEST ITEM" and continue to bind my T...

Events from inside a DataBound Control

I have an asp:Repeater with an asp:DropDownList in it. The DropDownLists in the repeater raise their SelectedIndexChanged events on every postback, regardless of whether they were changed or not. Is this a known issue in ASP.NET? Do you know how to work around it? I found this workaround but would like something prettier if at all po...

AutoComplete intergrated with a GridView

I'm was wondering if anyone know of an implementation where there is an autocomplete textbox that drives what displays in the DataBound control like GridView, Repeater, ListView,etc.....Any links or advice will be helpful. Thank You, ...

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...