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...
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 ...
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...
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...
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...
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...
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 ...
With the MVVM pattern, how does one go about dynamically binding
an ICommand to the click event of a hyperlink inside of a
RichTextBox?
...
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...
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...
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?
...
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...
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)
...
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...
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 ...
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...
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...
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...
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.
...
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...