databinding

Binding datasource to a repeater in asp.net

hi guys, I have a repeater which contain thumbviewer.I used following code to bind repeater Dim files As IList(Of FileInfo) = New List(Of FileInfo)() Dim dtDoc As DataTable = objdoc.GetDocDetails(Session("RegID")) Dim filters As String = "*.jpg;*.png;*.gif" For Each filter As String In fi...

Two Way Binding on Multi-select WinForms Listbox?

I have a project where we are loading a multi-select listbox from a collection of objects. I have another entity object that has a collection that I want to bind to SelectedItems somehow. Is there any way to do this using object binding sources or some kind of binding source without writing code? Sure I can loop through the collection ...

WPF: DependencyProperty refusing to work.

I'm trying to register 3 dependency properties on a Window to control it's formatting. I've looked over and over the code but I must be missing something. public static readonly DependencyProperty TextColorProperty = DependencyProperty.Register("TextColor", typeof(Color), typeof(WinStickyFingers), new PropertyMetadata(Colors.White)); pu...

What causes a Value Converter to fire?

I am setting an IsEnabled property of a control based on whether or not a SelectedIndex >= 0 in a ListBox. I can do this in the code behind, but I wanted to create a value converter for this behavior since it is something I do frequently. I created this Value Converter to handle the task and bound it to the IsEnabled property: [Va...

WPF: How do I bind the color property of a gradientstop that is located in a controlTemplate in vb code?

I need to do this in order to create a dynamic background brush for a custom control (inherits ContentControl). My custom control has two dependency properties: StartColor and EndColor. In the control template for the custom control, the control is wrapped in a border that's background is a RadialGradientBrush with gradient stops. one gr...

ASP:RadioButtonList Databind Custom Object

Hey guys, I'm having a bit of trouble with my ASP:RadioButtonList, searched Google and SO, no luck, can you help me out? I'm having trouble databinding. I've got a custom class that looks like this: public class myClass{ public myInnerClass{ public int myID; public String myTextField; /* other fields*/ } public List<m...

Pattern for "unavailable" value when databinding in WPF

What is the typical pattern for displaying an "unavailable" value when databinding in WPF? For example I am using MVVM, and TextBlocks in my view are bound to my viewmodel's properties, some of which are ints. There are times when I want to temporarily display two dashes ("--") in my view rather than the property value. I could change ...

How to bind a WPF hyperlink in a richtextbox to a command?

With the MVVM pattern, how does one go about dynamically binding an ICommand to the click event of a hyperlink inside of a RichTextBox? ...

updating dataset using join and bindingsource?

Hi, I have created a dataset and in the designer I have created the relations and foreign keys that exist in the database. Basically, I have a product that has a relationship to a table of prices. The keyfield they share is IdProduct in the Prices table. In the Fill/Get of the product I return the Price field. I also have a DataGrid t...

WPF: Weird data-binding issue when using same data source on two controls

So i have a combo box on the main window of my WPF app. I bind a List accessed through a singleton to the ItemSource of the combo box. All is fine. In a child window that the user can open, i have a ListBox bound to the same List in the singleton. The Problem: when i change the selection of the list box in the child window, i can see t...

When does the DataBinding event fire during the ASP .NET page lifecycle?

Simply, if I have a GridView with a SqlDataSource control declarative set as its data source, when does that data source retrieve its data and when does the binding take place in the page lifecycle? ...

WPF Binding Help

I haven't used WPF that much so the solution to this is probably pretty easy. In the ide I'm developing it will have multiple controls(text editor) each being hosted in a tab, much like VS does for each source file. When the user clicks new the "host" creates a new EditorWindow(a usercontrol), creates a new tab, and tells the tab to di...

Data binding not updating.

I created a simple example with data binding (unfortunately we have a similar case in our system). I created a funky combo box: public class FunkyComboBox : ComboBox { private object currentValue = null; public FunkyComboBox() { if (LicenseManager.UsageMode == LicenseUsageMode.Runtime) ...

How to get datatable as a result of stored procedure

hi guys, Following is my stored procedure. ALTER PROCEDURE SP_GetModels ( @CategoryID bigint ) AS BEGIN Select ModelID,ModelName From Model where CategoryID=@CategoryID END and i am calling stored procedure in code behind as public SqlConnection conn; public SqlDataReader GetModels() { DataTable d...

Silverlight 3 user control data Binding in xaml

I’m trying to achieve something that is conceptually quite simple but can’t seem to get it working. I have a class called c1 it has 2 dependency properties in it an integer I and a string S. It implements INotifiyPropertyChanged. public class c1: INotifyPropertyChanged { private int i; public int I { get { return i; } set { i ...

How to handle a few dozen flags in a database

Like most apps, mine has a "users" table that describes the entities that can log in to it. It has info like their alias, their email address, their salted password hashes, and all the usual candidates. However, as my app has grown, I've needed more and more special case "flags" that I've generally just stuck in the users table. Stuff...

Troubles with the SQLDataSource object

Now I know why I just use MySQL and unbound objects... this SQLDataSource thing is for the birds... anyways, since I have to use it for my project, I've got a .ascx user control with a repeater attached to an SQLDataSource object. I'm trying to dynamically pass in a parameter based on a selection in a dropdown box on the parent page. How...

How can I refresh only the visible rows of a data bound DataGridView?

I have a DataGridView bound to a list of custom objects created on the fly. This list is not very large, 5000 items maximum. However, the values of the custom objects change every 50ms and the grid hangs the application while refreshing the values and it ultimately crashes. My question is: is there a way to "virtualize" the data binding...

How can I hide a Paragraph in a FlowDocument?

Is there any way to use databinding to show or hide a Paragraph within a FlowDocument? (I want to use MVVM, but with a FlowDocument as my view.) Paragraph doesn't have a Visibility property. I'm not sure what else to look for. ...

Is there an ItemsControl equivalent for text content?

I have some data that I want to present in a FlowDocument. This will basically be a view that explains the data in a friendly way, with section headers, paragraphs of text, etc., and which I will display in a FlowDocumentScrollViewer. To this end, I would like to create a bulleted list (<List>) out of the contents of an ObservableCollec...