databind

Add New Row to GridView without DataBind

Hello all, I have a GridView that allows editing the values in every column, in every row, all the time. The user enters in all their changes, clicks Save once and all changes are commited. The user must also be able to click the New button, have a new row appear in the GridView (yep, it has to show up in the actual GridView), enter w...

GridView .DataBind RowDataBound not firing

hello - i hope someone can help! i have a user control that has a gridview (there is an update panel in the UC) i'm using this UC on 2 different pages - on both pages, the UC is on a tab (ajax tabpanel) with the tab being inside an update panel. on 1 page, when i use the .DataBind() (not initial load), it fires the RowDataBound event a...

Why does ObservableCollection hide INotifyPropertyChanged.PropertyChanged

I have a class that derives from ObservableCollection. I wanted to add some properties to this class (not the items in the collection) but have discovered that its implementation of PropertyChanged is protected. Since its protected I assume that is why my attempts at binding to these new properties in XAML are failing. Short of creating...

ASP.NET AcessDataSource and dropdownlist

Hi I'm using visual studio 2008 with .net 3.5. I have an AccessDataSource that is linked to a access database. I have a dropdownlist that use the AccessDataSource. Everything was done with the wizard and everything was working just fine. At the page load I decided to call the SelectedIndexChanged of my dropdownlist to update someth...

DataBinding Eval To 2 Decimal Place Doesn't Show 0

Hi, Platform: C# ASP.NET 3.5 I have a ListView which builds a Rate field which is decimal, if I simply have <% #Eval("Rate") %> it shows 4.5000 rather than 4.5 if I use <% #Eval("Rate","{0:#.##}") %> it shows 4.5 but doesn't display 0 any suggests on how to bind the decimal field but still show 0 Thanks Lee ...

Duplicating DropDownListItems Without Looping

This works like a charm... loading DropDownList2 with all the items from DropDownList1 without looping: DropDownList2.DataSource = DropDownList1.Items; DropDownList2.DataBind(); But, the data from the item text of DropDownList1 is copied into both the text and value fields of DropDownList2. Is there anyway to get both the text and the...

Datbinding in code behind and using Listview cause select button to be clicked twice

Hello, I have a problem using the asp:ListView component. I have a search page, where the user can search on different fields in the database. When clicking the search button I do a search in the database and binds the result to a ListView inside the click button event. The reason why I want to use a ListView for this task is that each ...

inline or databind expressions in ASP.NET

it's a related question to this one, but merits its' own question. If I need to call a server-side function inside my EditItemTemplate of my DataList, should I use <%=ServerSideFunction(...)%> or <%#ServerSideFunction(...)%>? Both work since there is a databind going on with the DataList ...

Can I create a RDLC and databind a table at run time without creating dataset in design time?

Hi guys Just wondering if it's possible to databind a RDLC's table at run time. I've created a report, put a table control, but VS compiler says it's necessary to set a dataset. But I wanted to load data into this table using a dataset created in C# code, and not creating dataset and table adapter. Is it possible? thank you ...

Updating the datatable behind a textbox?

Using windows.forms, I have a tabcontrol with a listbox and several textboxes all bound to a datatableadapter. When the user selects a member in the listbox the corresponding textboxes are populated. The problem is that, when the user edits the text in a textbox it is not being written back to the datatable. So when they select a differ...

Creating a DataTable object with dummy data

I am trying to databind a DataTable to an accordion and I have found that If I retrieve the DataTable from a database using a table adapter it binds to the accordion perfectly however what I want to do is create a dummy table (for testing purposes if I don't have access to my database) the code to create the dummy table is below: Da...

Dynamic databinding to gridview

Hi, I've a grid view and I want to bind some data to this Gridview at runtime. In my button click event I wrote like this protected void Button1_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataRow dr; DataColumn dc = new DataColumn(); dc.Caption = "Name"; ...

[C#] Creating my own component with DataSource and DataBind()

Hi, I want to do my component that works similar to most of data controls (MS, Telerek, etc.): myControl.DataSource = new List<myClass>(); mycontrol.NameField = "Name"; myControl.ValueField = "Value"; myControl.DataBind; I have some test code: class myClass { public String Name { get { return _name; } } ... } class c...

Question about databinding to non-UI elements

I'm very new to databinding, and so far have only had luck databinding to element properties in the GUI, or by binding to an ObservableCollection to display lists of data. Now I want to do something different. I have a method that takes an index and returns a List of doubles, i.e. List<double> GetValues( int index); I have a GUI whe...

Binding a radgrid to a tree like data structure

I have a structure that looks following Class TreeNode { public TreeNode Parent { get; } public IEnumerable<TreeNode> Children { get; } public . . . . } I want to bind this to a asp.net telerik radgrid with detail tables for each level of the children. I know that radgrid supports declarative binding to a self referenci...

WPF - Attach Binding Debugging when Binding is not in a string

Debugging a binding when it is like this IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Mode=TwoWay, Path=IsSelected}" is easy. You add the following: xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" IsChecked="{Binding RelativeSource={Relat...

System.Web.HttpException was unhandled by user code. Message="A field or property with the name

I am getting the below exception when I run my ASP.NET/C#/SQL project on an XP box: System.Web.HttpException was unhandled by user code Message="A field or property with the name 'DisplaySchemaTables()' was not found on the selected data source." Source="System.Web" ... Can u advise me on what the problem might be? Here is the code c...

How to set the database in ASP.Net

I have a database at location xmachina\sqlexpress named News, News has a table NewsTable. How do I tell ASP to look at News database? Is it part of the SelectCommand? Or a webconfig variable? Right now I get a [SqlException (0x80131904): Invalid object name 'NewsTable'.] web.config <add name="NewsTableConnectionString" connection...

Wrangling datacontrols - Gridview with datasource, but using templates?

Hi, As apart of my learning, I want to learn more about the data controls in asp.net. I have used the gridview in situations where it is specifically bound to an sql data source and handles updates and deletes really easily, but I have thought of something that I want to model, however am not sure which control is best to use. The situ...

C# WPF Databinding to Unkown Amount of Checkboxes

In my application I generate CheckBoxes for each possible category (retrieved from a database) and the user can check any number that apply. I name the checkboxes "cbCategory[ID]" where ID is the ID of that category in the database. I then need to generate some sort of collection class (as a property of my object class) to store the cat...