Search Results

Search found 4490 results on 180 pages for 'binding'.

Page 32/180 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Binding a slider value on the height of its thumb in WPF

    - by sofri
    Hi, I have a databinding problem in WPF. I would like to "customise" a slider in a way that the thumb grows when you move the slider to the right and the thumb shrinks when you move the slider to the left. So I edited the template for the slider and changed the look of the slider so the slider looks like I want it to. But now I have to bind the height of the thumb to the value of the slider but I do not know how that works. I did some simple data binding things but I cannot figure out how I can bind this "thumb height" that's inside of my slider's template to the slider's value that's inside the User Control where my slider is in. So how can I do it?

    Read the article

  • Emacs key binding in Eclipse IDE

    - by Peter Delaney
    Hello; I am an Emacs lover probably because I love the key binding and I am able to do things very quickly. I also use Eclipse IDE for my Java/Android/Python/ development because it is free, most of my peers use it, and it works. I find myself switching between emacs and Eclipse and the workflow just isn't great. What I would like to do is setup the key bindings in Eclipse so that they are like Emacs. Can someone suggest the best Eclipse plugin I could use for this. Or can anyone talk about how they've used Eclipse to be more Emacs like. Thanks in advance

    Read the article

  • WPF - Binding a color resource to the data object within a DataTemplate

    - by John
    I have a DataTemplate and a SolidColorBrush in the DataTemplate.Resources section. I want to bind the color to a property of the same data object that the DataTemplate itself is bound to. However, this does not work. The brush is ignored. Why? <DataTemplate DataType="{x:Type data:MyData}" x:Name="dtData"> <DataTemplate.Resources> <SolidColorBrush x:Key="bg" Color="{Binding Path=Color, Converter={StaticResource colorConverter}" /> </DataTemplate.Resources> <Border CornerRadius="15" Background="{StaticResource bg}" Margin="0" Opacity="0.5" Focusable="True"> </DataTemplate>

    Read the article

  • CheckBox ListView SelectedValues DependencyProperty Binding

    - by Ristogod
    I am writing a custom control that is a ListView that has a CheckBox on each item in the ListView to indicate that item is Selected. I was able to do so with the following XAML. <ListView x:Class="CheckedListViewSample.CheckBoxListView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d"> <ListView.Style> <Style TargetType="{x:Type ListView}"> <Setter Property="SelectionMode" Value="Multiple" /> <Style.Resources> <Style TargetType="ListViewItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListViewItem"> <Border BorderThickness="{TemplateBinding Border.BorderThickness}" Padding="{TemplateBinding Control.Padding}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True"> <CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}"> <CheckBox.Content> <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /> </CheckBox.Content> </CheckBox> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </Style.Resources> </Style> </ListView.Style> </ListView> I however am trying to attempt one more feature. The ListView has a SelectedItems DependencyProperty that returns a collection of the Items that are checked. However, I need to implement a SelectedValues DependencyProperty. I also am implementing a SelectedValuesPath DependencyProperty. By using the SelectedValuesPath, I indicate the path where the values are found for each selected item. So if my items have an ID property, I can specify using the SelectedValuesPath property "ID". The SelectedValues property would then return a collection of ID values. I have this working also using this code in the code-behind: using System.Windows; using System.Windows.Controls; using System.ComponentModel; using System.Collections; using System.Collections.Generic; namespace CheckedListViewSample { /// <summary> /// Interaction logic for CheckBoxListView.xaml /// </summary> public partial class CheckBoxListView : ListView { public static DependencyProperty SelectedValuesPathProperty = DependencyProperty.Register("SelectedValuesPath", typeof(string), typeof(CheckBoxListView), new PropertyMetadata(string.Empty, null)); public static DependencyProperty SelectedValuesProperty = DependencyProperty.Register("SelectedValues", typeof(IList), typeof(CheckBoxListView), new PropertyMetadata(new List<object>(), null)); [Category("Appearance")] [Localizability(LocalizationCategory.NeverLocalize)] [Bindable(true)] public string SelectedValuesPath { get { return ((string)(base.GetValue(CheckBoxListView.SelectedValuesPathProperty))); } set { base.SetValue(CheckBoxListView.SelectedValuesPathProperty, value); } } [Bindable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Category("Appearance")] public IList SelectedValues { get { return ((IList)(base.GetValue(CheckBoxListView.SelectedValuesPathProperty))); } set { base.SetValue(CheckBoxListView.SelectedValuesPathProperty, value); } } public CheckBoxListView() : base() { InitializeComponent(); base.SelectionChanged += new SelectionChangedEventHandler(CheckBoxListView_SelectionChanged); } private void CheckBoxListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { List<object> values = new List<object>(); foreach (var item in SelectedItems) { if (string.IsNullOrWhiteSpace(SelectedValuesPath)) { values.Add(item); } else { try { values.Add(item.GetType().GetProperty(SelectedValuesPath).GetValue(item, null)); } catch { } } } base.SetValue(CheckBoxListView.SelectedValuesProperty, values); e.Handled = true; } } } My problem is that my binding only works one way right now. I'm having trouble trying to figure out how to implement my SelectedValues DependencyProperty so that I could Bind a Collection of values to it, and when the control is loaded, the CheckBoxes are checked with items that have values that correspond to the SelectedValues. I've considered using the PropertyChangedCallBack event, but can't quite figure out how I could write that to achieve my goal. I'm also unsure of how I find the correct ListViewItem to set it as Selected. And lastly, if I can find the ListViewItem and set it to be Selected, won't that fire my SelectionChanged event each time I set a ListViewItem to be Selected?

    Read the article

  • Getting the Action during model binding

    - by Kieron
    Hi, Is there a way of getting the Action, and reading any attributes, during the model binding phase? The scenario is this: I've got a default model binder set-up for a certain data-type, but depending on how it's being used (which is controlled via an attribute on the action) I need to ignore a set of data. I can use the RouteData on the controller context and see the action name, which I can use to go get the data, but wondered if that information is already available. Additionally, if the action in question is an asynchronous one, they'd be more processing involved in looking it up...

    Read the article

  • .NET Framework 3.5, Assembly Binding Logging

    - by Achilles
    I am getting the following error: Could not load file or assembly 'System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. I've researched the problem and some of the solutions are pointing to Turning on Assembly Binding Logging. I'm confused as to what this error is. So my question: *What does this error mean and how do I resolve it? I am not hosting the site in a shared hosting scenario, it is on a single server running .NET Framework 3.5.0 using IIS 6.0 Edit .Net Framework 3.5 SP 1 isn't installed on the server. The missing assemblies are apart of that Service Pack.

    Read the article

  • ASP.NET Binding integer to CheckBox's Checked field

    - by Sung Meister
    I have a following ListView item template, in which I am trying to bind integer value to Checked property of CheckBox. IsUploaded value contains only 0 and 1... <asp:ListView ID="trustListView" runat="server"> <ItemTemplate> <asp:CheckBox ID="isUploadedCheckBox" runat="server" Checked='<%# Bind("IsUploaded") %>' /> </ItemTemplate> </asp:ListView> But ASP.NET complains that Exception Details: System.InvalidCastException: Sepcified cast is not valid Even though following code using DataBinder.Eval() works, I need to have a 2-way binding, thus need to use Bind(). <asp:CheckBox ID="isUploadedCheckBox2" runat="server" Checked='<%# Convert.ToBoolean( DataBinder.Eval(Container.DataItem, "IsUploaded"))) %>' /> How can I convert 0's and 1's to boolean using Bind()? [ANSWER] I have extended auto-generated type through partial class by adding a new property mentioned in the answer by Justin

    Read the article

  • Remove a keyboard shortcut binding in Visual Studio using Macros

    - by Pete
    Hi. I have a lot of custom keyboard shortcuts set up. To avoid having to set them up every time I install a new visual studio (happens quite a lot currectly, with VS2010 being in beta/RC) I have created a macro, that sets up all my custom commands, like this: DTE.Commands.Item("ReSharper.ReSharper_UnitTest_RunSolution").Bindings = "Global::Ctrl+T, Ctrl+A" My main problem is that Ctrl+T is set up to map to the transpose char command by default. So I want to remove that default value in my macro. I have tried the following two lines, but both throw an exception DTE.Commands.Item("Edit.CharTranspose").Bindings = "" DTE.Commands.Item("Edit.CharTranspose").Bindings = Nothing Although they kind of work, because they actually remove the binding ;) But I would prefer the solution that doesn't throw an exception. How is that done?

    Read the article

  • How to Set a gridview column width when binding to a datatable

    - by Bob Avallone
    I am binding a table to a gridview in asp.net as such grdIssues.DataSource = mdtIssues; grdIssues.DataBind(); The problem is I cannot then control the column width, asp.net seems to decided on it's own what width each column should be. Methods such as grdIssues.Columns[0].ItemStyle.Width = 100; grdIssues.Columns[1].ItemStyle.Width = 100; don't work because the columns are created dynamically. I cannot believe there isn't a way to do this short of manually creating each column and filling each row. Regards, Bob Avallone

    Read the article

  • Maintain Added List Item while binding from datasource

    - by Kronass
    Hi, I have a drop down list, and I added some items in it as follows <asp:DropDownList ID="ddlInsAuther" runat="server" DataSourceID="ObjectDataSourceInsAuthers" DataTextField="AutherName" DataValueField="AutherID"> <asp:ListItem Value="-1">No Authers</asp:ListItem> </asp:DropDownList> And in Datasource <asp:ObjectDataSource ID="ObjectDataSourceInsAuthers" runat="server" SelectMethod="GetAll" TypeName="MyProject.BusinessLayer.AuthersFactory"> </asp:ObjectDataSource> When it loads it clears the list and loads the new items, I don't want to make a custom binder on page load, how can I maintain my added items in the list while binding from datasource?

    Read the article

  • MVC DateTime binding with incorrect date format

    - by Sam Wessel
    Asp.net-MVC now allows for implicit binding of DateTime objects. I have an action along the lines of public ActionResult DoSomething(DateTime startDate) { ... } This successfully converts a string from an ajax call into a DateTime. However, we use the date format dd/MM/yyyy; MVC is converting to MM/dd/yyyy. For example, submitting a call to the action with a string '09/02/2009' results in a DateTime of '02/09/2009 00:00:00', or September 2nd in our local settings. I don't want to roll my own model binder for the sake of a date format. But it seems needless to have to change the action to accept a string and then use DateTime.Parse if MVC is capable of doing this for me. Is there any way to alter the date format used in the default model binder for DateTime? Shouldn't the default model binder use your localisation settings anyway?

    Read the article

  • beginner's ruby question: how to use erb to output file after binding

    - by john
    Hi, I got the following example: require 'erb' names = [] names.push( { 'first' => "Jack", 'last' => "Herrington" } ) names.push( { 'first' => "LoriLi", 'last' => "Herrington" } ) names.push( { 'first' => "Megan", 'last' => "Herrington" } ) myname = "John Smith" File.open( ARGV[0] ) { |fh| erb = ERB.new( fh.read ) print erb.result( binding ) accompanied by text.txt <% name = "Jack" %> Hello <%= name %> <% names.each { |name| %> Hello <%= name[ 'first' ] %> <%= name[ 'last' ] %> <% } %> hi, my name is <%= myname %> } it prints nicely to screen. what is the simplest way to output another file: "text2.txt"? thank you!!!

    Read the article

  • JavaScript function binding (this keyword) is lost after assignment

    - by Ding
    this is one of most mystery feature in JavaScript, after assigning the object method to other variable, the binding (this keyword) is lost var john = { name: 'John', greet: function(person) { alert("Hi " + person + ", my name is " + this.name); } }; john.greet("Mark"); // Hi Mark, my name is John var fx = john.greet; fx("Mark"); // Hi Mark, my name is my question is: 1) what is happening behind the assignment? var fx = john.greet; is this copy by value or copy by reference? fx and john.greet point to two diferent function, right? 2) since fx is a global method, the scope chain contains only global object. what is the value of this property in Variable object?

    Read the article

  • Manually insert items into DDL after data binding...

    - by WeeShian
    I have a dropdownlist, which dynamically populate data from SQL Server and i wanna manually insert two items on top of the DDL after data binding. So, the DDL would has data something like this: Select Branch (manually insert) ALL (manually insert) AIR AMP ABG ... I tried to achieve it by using code below: ddlBranch.Items.Insert(0, "Select Branch") ddlBranch.Items(0).Value = CMM.sExcVal1 ddlBranch.Items.Insert(1, "ALL") ddlBranch.Items(1).Value = "ALL" but it comes out giving me the data like this: Select Branch (manually insert) ALL (manually insert) ('AIR' branch should be here but it's gone) AMP ABG ... After manually insert the 'ALL' item into the DDL, the 'AIR' is gone which is already replaced by the 'ALL'. How can i remain all the data from server and at the same time i can manually insert two items?

    Read the article

  • Problem with binding from style

    - by Maurizio Reginelli
    I have this block of xaml and I made a ViewModel which contains a property called MyBrush. I would like to set the grid background to that property but this block doesn't work. Could you tell me how can I do that? <Style x:Key="myKey" TargetType="myType"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="myType"> <Grid Background="{Binding RelativeSource={RelativeSource Self}, Path=MyBrush}"> ...

    Read the article

  • Ajax data two-way data binding strategies?

    - by morgancodes
    I'd like to 1) Draw create form fields and populate them with data from javascript objects 2) Update those backing objects whenever the value of the form field changes Number 1 is easy. I have a few js template systems I've been using that work quite nicely. Number 2 may require a bit of thought. A quick google search on "ajax data binding" turned up a few systems which seem basically one-way. They're designed to update a UI based on backing js objects, but don't seem to address the question of how to update those backing objects when changes are made to the UI. Can anyone recommend any libraries which will do this for me? It's something I can write myself without too much trouble, but if this question has already been thought through, I'd rather not duplicate the work.

    Read the article

  • Binding multiple arrays for WHERE IN in PostgreSQL

    - by Alec
    So I want to prepare a query something like: SELECT id FROM users WHERE (branch, cid) IN $1; But I then need to bind a variable length list of arrays like (('a','b'),('c','d')) to it. How do I go about doing this? I've tried using ANY but can't seem to get the syntax right. Cheers, Alec Edit: After some fiddling around, this is valid syntactically: SELECT id FROM users WHERE (branch, cid) = ANY ($1::text[][]); and then binding the string '{{a,b},{c,d}}' to $1 but throws the error "operator does not exist: record = text". Changing 'text' to 'record' then throws "input of anonymous composite types is not implemented". Any ideas?

    Read the article

  • Exception of Binding form data to object

    - by Captain Kidd
    I'm practising Spring MVC.But fail to populate command object in Controller when I use spring standard tag. For example: "form:input path="password"" But I perfectly do this with HTML standard tag. Like: "input type="text" name="password"" I wonder the way how to use Spring tag binding data. In addition, I think configuration and coding is right in my sample. protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { UserFormBean b = (UserFormBean)command; System.out.println("s"); return super.onSubmit(request, response, command, errors); } <form:form commandName="command" action="/SpringFrame/register.html"> <form:input path="password"/> <!-- <input type="text" name="password"/> --> <input type="submit"/> </form:form>

    Read the article

  • How does Model binding with a selectlist work?

    - by rsteckly
    Hi, I'm having problems retrieving the values of a selectlist in my form collection. I've tried making a viewmodel with an attribute with the same name as the select list. I'm honestly just realizing I REALLY don't understand how model binding works with selectlists. I've just been assuming that the following conventions apply: Name the select list the same thing as the attribute on the model you want it to bind to. Apart from that, I really don't get it. I've looked at several books on it and they're useless frankly. How does a select list work with a) form collection and b) a particular model?

    Read the article

  • PHP form post, automatically mapping to an object (model binding)

    - by Pete Nelson
    I do a lot of ASP.NET MVC 2 development, but I'm tackling a small project at work and it needs to be done in PHP. Is there anything built-in to PHP to do model binding, mapping form post fields to a class? Some of my PHP code currently looks like this: class EntryForm { public $FirstName = ""; public $LastName = ""; } $EntryForm = new EntryForm(); if ($_POST && $_POST["Submit"] == "Submit") { $EntryForm->FirstName = trim($_POST["FirstName"]); $EntryForm->LastName = trim($_POST["LastName"]); } Is there anything built-in to a typical PHP install that would do such mapping like you'd find in ASP.NET MVC, or does it require an additional framework?

    Read the article

  • Does ActiveState PerlApp have a problem binding ico files as "Bound Files"

    - by Lozzer
    I posted this question at ActiveState but got no reply from support or in a discussion forum. Here is probably better. I'm a long time user of PerlApp (ver. 8.2.1 Build 292072) and I have experienced very few problems. But just recently, I've been creating a new Tkx app and hit a problem. Tkx allows ico files to be used in the application (replacing the Tk icon) and this works perfectly in development. But, when I have tried binding my ico file in "Bound Files" of PerlApp it refuses to work and the only way to get my app to run is by putting the original ico file in the same folder as the exe. I have tried changing the name of the "Icon Sources" ico file, removing the "Icon Sources" ico file completely, but the "Bound Files" ico file refuses to be bound. Any suggestions?

    Read the article

  • Binding a combobox in XAML to a childwindow property

    - by AlexB
    Hi, I want to display a child window that contains a combobox with several values coming from one of the child window's property: public partial class MyChildWindow : ChildWindow { private ObservableCollection<MyClass> _collectionToBind = // initialize and add items to collection to make sure it s not empty... public ObservableCollection<MyClass> CollectionToBind { get { return _collectionToBind; } set { _collectionToBind = value; } } } How do I bind in XAML my combobox to the ComboBoxContent collection (both are in the same class)? I've tried several things such as: <ComboBox x:Name="linkCombo" ItemsSource="{Binding Path=CollectionToBind }" DisplayMemberPath="Description"> I've only been able to bind it in the code behind file and would like to learn the XAML way to do it. Thank you!

    Read the article

  • Chronoscope with GWT - ChronoscopeBrowserInjector binding failed

    - by Gknee
    I want to use Timepedia Chronoscope (http://code.google.com/p/gwt-chronoscope/) in my GWT application. I have all the configuration like shown on chronoscope project site: chronoscope-1.0.jar in gwt-2.0.x applications: gwt-user-2.0.x and gwt-servlet-2.0.x chronoscope-api-1.0.jar gwtexporter-2.0.10.jar gin-1.0.jar I've inherited chornoscope module. I get the error from gwt plugin to eclipse that looks like that: java.lang.RuntimeException: Deferred binding failed for 'org.timepedia.chronoscope.client.browser.Chronoscope$ChronoscopeBrowserInjector' (did you forget to inherit a required module?) Can you help me?

    Read the article

  • Asp.net Date Binding Issue with Nulls

    - by Matthew Kruskamp
    I have a nullable date in my database. I am connecting to it with a LinqDataSource, and binding with a FormView. It allows you to place dates fine, but if you remove the date I need it to insert the null value to the db. It is instead throwing an exception. <asp:TextBox ID="TxtStartDate" runat="server" Text='<%# Bind("StartDate", "{0:MM/dd/yyyy}") %>' /> Works fine if you place a date in it, but if you delete the date out of it and save, you get System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. How do I make it send null?

    Read the article

  • Cheapest way of binding local variable to closure

    - by mmotorny
    I believe following to be a cheapest way of binding local variable to closure: void ByRValueReference(A&& a) { } std::function<void ()> CreateClosureByRValueReference() { A a; std::function<void ()> f = std::bind(&ByRValueReference, std::move(a)); // !!! return f; } However, it does not compile under Clang 3.1: error: no viable conversion from '__bind<void (*)(A &&), A>' to 'std::function<void ()>' and gcc 4.6.1: /usr/include/c++/4.6/functional:1778:2: error: no match for call to ‘(std::_Bind<void (*(A))(A&&)>) ()’ Am I violating the standard or it's just broken standard libraries?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >