databinding

Use ASP.net DataGrid with temporary table (from Stored Proc)

Hi, I have a datagrid that is bound to the results of an Stored Proc (a temp table), in code. Something like: DataView _sendTo; SqlDataSourceMatches.SelectCommand = EXEC get_matches 1, 2, 3 // The S/P returns multiple data sets DataSet ds = ((DataView)SqlDataSourceMatches.Select(DataSourceSelectArguments.Empty)).Table.DataSet; ...

Binding and routing or url generation problem in Asp.NET Mvc application

In my view the call below generates url ending with Tasks/Edit but I want it to generate url like Tasks/Edit/23 <%= Html.ActionLink<TaskController>("Edit Task", (x) => x.Edit("23"))%> in Global.asax: string taskController = NameResolver.NameOfController<TaskController>(); string editAction = NameResolver.NameOfAction<TaskController>...

WPF Custom Control "OnSourceTypeChanged" method is not invoked

Hey pals, let's put it short: I'm trying to create a WPF custom control that inherits from WPF Image. I have added a dependency property called "Source Type" to my control so that when databound it sets the "Source" property of the image to what I want. But the problem is that my method to perform the source changing task (i.e "OnSourc...

WPF: Issue with OverFlow Panel on Toolbar control

Hi pals, I'm having an issue working with the Toolbar control for WPF in Blend 3: I have a Toolbar control that is binded to a collection so that it displays both icons and labels for each one of the actions that users can perform on this application. The issue I'm having is that when I run the application the buttons are displayed ins...

M-V-VM WPF: Way to maintain Databinding while passing parent object of Databound object into IValueConverter?

I'm using model-view-viewmodel I currently have a class with 3 pieces of data: 2 integers and an enumeration. Its constructor looks like this: //C# public Outcome(OutcomeEnum outcomeEnum, Int32 acutalOutcomeData, Int32 expectedOutcomeData) { m_outcomeEnum = outcomeEnum; m_actualData = acutalOutcomeData; m_expectedData = expected...

Custom LINQ expression Gridview Bind

Hello all. I am following the good old Scott Gu LINQ to SQL guide to LINQ and have stumbled upon a query. Here is my scenario. I have a textbox a client should populate with a number (tbxHowMany), two radio buttons that define a material (radPaper & radGlass). A also have a button (btnReturn) that when clicked, a gridview (gridview1) ...

WPF control and parsing/binding to a given string

Hey guys, I am new to WPF and am trying to create a WPF control that displays a string (which will always be a number) in a particular way. There will be three different text fields on the control and the string needs to be split up into three different components following these rules: Lets say you have the string "1.5678". The cont...

How would you explain databinding to your grandmother?

today i thought about how to explain a databind in asp.net that also a grandmother is able to imagine it. I couldn't but use it every day. ...

What is the best way to databind Web Form controls to linq objects?

I have a typical object (it comes from Linq but it could have been create manually): public class Person { public string FirstName{get; set;} public string LastName{get; set;} public int Age{get; set;} } And I have a Web Form where users enter this data: <asp:TextBox runat="server" ID="FirstName"></asp:TextBox> <asp:TextBox run...

How to bind ServletRequest params to domain objects?

I want to bind parameters of a ServletRequest to arbitrary domain objects. Params are available as a map of type Map<String, String[]> // String = key, String[] = values They should be converted and bound to the fields of the target object. Id like to have a method like this: // definition: public void bind(Map<String, String[]>, T...

how to reset the name attribute of a input control after a jquery action

i have an html table inside a form in an asp.net mvc view. I am using the tablesorter jquery plugin as well. Here is the table code (simplified for the example) <table id=managersTable> <thead> <tr> <th>Manager</th><th>Remove</th> </tr> </thead> <tbody> <tr> <td>Manager 1<input type='hidden' name='updat...

In WPF, how to databind to the Window DataContext from inside the DataTemplate of a contained ListBox?

I have a WPF Window with a view model set as its DataContext, and have a ListBox with a DataTemplate and its ItemsSource bound to the view model, like in the following example: View model: using System.Collections.Generic; namespace Example { class Member { public string Name { get; set; } public int Age { get; set; } } ...

Data binding the TextBlock.Inlines

My WPF App receives a stream of messages from a backend service that I need to display in the UI. These messages vary widely and I want to have different visual layout (string formats, colors, Fonts, icons, whatever etc.) for each message. I was hoping to just be able to create an inline (Run, TextBlock, Italic etc) for each message ...

Screen synchronization - Event Aggregator VS Caching ViewModel References...

Hi, i did some homework and couldn't find any article about best practices about when to use each method.. just for clarification: When using the event aggregator pattern : each screen has it's own reference of a viewmodel, the viewmodel publish changes using the eventaggregator, which later the observers use to synchronize their state....

Entity binding to select table columns

I am just learning to use the Entity framework and I wondered how I can bind to a select few columns with my WPF Toolkit datagrid? Can someone give me an example? I've tried to set the DataContext to the Person Entity for example and then set the Itemsource binding path to a single column of the table, but it does not work. ...

Debugging Data Binding in Winforms C# ?

Hi there. I'm getting alot of issues lately in a project im working on with databinding. When im about to display a certain form that has bindings inside its controls, the .Show method throws expcetions regarding the binding - "Cannot bind to property or column on datasource. Parameter name: dataMember.". Now, I'm quite aware this is a...

Databinding and Triggers compatability in WPF

Hi all, I have a problem. I made a template for a TreeView and I need to set the initial value of the ToggleButton's IsChecked property depending on my model. But it turns out that setting this property using triggers/setters disables the databinding. Is it so? If yes, give me a suggestion how it can be fixed? <DataTemplate x:Key="Cel...

Making DBX recognize booleans with Firebird

The Firebird FAQ explains how to create a BOOLEAN domain. Probably the most interesting part is at the end, where it says: If you use a connectivity library like OleDB under .Net, you can override the OleDB provider's GetSchema method, so the DataTables you get from queries have native .Net booleans. Is there any way to do...

How to catch user changes in databound controls?

Hi. I have application full of various controls databound to my classes. I would like to ask user "You are closing application and you made some changes. Do you want to save your changes?". For this I need to recognize that user made any changes. How to catch user made changes in databound controls? Is textBoxXXX_TextChanged the only w...

Tab stop not working for textboxes inside data template

I'm writing a really simple name / value editor control where the value is editable - label on left and property text box on right. Control works fine except that when the user hits TAB when inside one of the "value" text boxes on the right, the focus shifts away from my control to the next control in the hiearchy. I want the focus to ...