w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
C# DataBinding - automatically writing changed property to label or textbox
I'm not sure if that is what you want but you can can write whatever you variable contains into the Textbox or Label by using the control.Text property. textBox1.Text ="Some other Text" or string variable = "Hello 2"; textBox1.Text = variable; Why dou you want to use Databinding? Its mutch easier this way.

Categories : C#

css position label text in the true center (vertical and horizontal) without moving the label
You can use line-height: 30px; to center a single line of text instead. The 30px needs to be the same value as the height of the element you wish to vertically center text in. Note: The fiddle has height:40px whereas the code in question has height:30px. Just choose the line-height to match the height. vertical-align would actually moving the entire <label> (and text) down but only applies to inline-level and table-cell elements. It is not applying in your case as the <label> is floated.

Categories : HTML

Highcharts x axis label text wrapping lost on setting label step
It's a bit of a hack, but you could replace each space in the name with <br /> by using the formatter: labels: { step: 1, formatter: function () { return this.value.replace(/ /g, '<br />'); } } It's not exactly what you want as it doesn't split the name according to the space available between ticks, but maybe you can improve the formatter to better suit your needs (splitting by a given n characters for example instead of by space). See it running here.

Categories : Highcharts

Xcode Autolayout: Place a label next to a dynamic label at a constant distance
Make sure that the spacing between your two labels is set to auto and that your days remaining label is left aligned. I suggest keeping a constraint between the trailing edge of your days remaining and the superview, but lowering the priority a bit. The goal there is to ignore it when the label should be far away from the superview, but not clip or go outside of the visible area when the date is very long. You may also need to increase the content hugging priority of the date label and/or decrease the compression resistance of your days remaining label. You may get better insight into what your labels are doing by setting the background color on them temporarily. The goal is to see how large your labels are, where the text is in the label, and where the spaces are. If there are lar

Categories : IOS

IOS Label Animation will not draw inside of label if changing the frame size
Ended up animating the image of the label / view. Here is the code, maybe will help someone. Assuming ARC and Quartz include. - (void) animateFromFrame:(CGRect)fromFrame toFrame:(CGRect)toFrame andView:(UIView*)view { UIGraphicsBeginImageContext(view.bounds.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageView* imageView = [[UIImageView alloc] initWithImage:image]; imageView.frame = fromFrame; imageView.layer.cornerRadius = 10; imageView.layer.borderWidth = 4; [self.view addSubview:imageView]; [UIView animateWithDuration:1.0 delay:0.25 options:nil animations: ^{ imageView.frame = toFrame; } completion:^ (BOOL finished) { [imageView

Categories : IOS

How can you drag and drop a list item to a label so it's the label's text in C#?
Test for correct type and then grab it: private void posLB_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { String s = e.Data.GetData(DataFormats.Text) as String; if (!String.IsNullOrEmpty(s)) posLB.Text = s; } }

Categories : C#

How to show label with line and display label outside in piechart in extjs4.1
You've got the display option of the label config, that you can set to 'outside'. As for the lines, you'll have to draw them yourself... Which would be a quite involved hack IMO. If you're interested in trying, that takes place in Ext.chart.Label#renderLabels(), and uses Ext.chart.series.Pie's onCreateLabel() and onPlaceLabel() methods. Don't forget to take your trigonometry with you before diving in there!

Categories : Extjs

If input box is empty show label, if there is text, hide label
yes there is, use keyup() function.. $('#name').keyup(function(){ if($(this).val() == ''){ $(this).prev().show(); }else{ $(this).prev().hide(); } }); this is considering your label is always the previous element of textbox else you can use.. $('#name').keyup(function(){ if($(this).val() == ''){ $('label[for="name"]').show(); }else{ $('label[for="name"]').hide(); } }); this gets that particular label whose attribute for is name.

Categories : Jquery

Click on Label and show Div (Label name change dynamically)
Try this HTML <label id="search">Advanced Search</label> <div id="searchContent" style="display:none;">Something</div> JavaScript $(function () { $("#search").click(function () { var text = $(this).text(); if (text === "Advanced Search") { $(this).text("Basic Search"); $("#searchContent").show(); } else { $(this).text("Advanced Search"); $("#searchContent").hide(); } }); }); Demo: http://jsfiddle.net/AM6Wz/

Categories : Jquery

Should i use Associatedcontrolid in label control to render label HTML tag?
The <label> element in html is a label for an <input> element. So the TextBox that is made as an <input> tag if it is associated with a asp:Label or ASPxLabel which is just an extention of the asp:Label will indicate to the .Net framework to translate it as a html <label> tag. In essence if you don't have a TextBox there is no point to translate the asp:Label to html tag. You had better add a new CSS class and format the span as you please if you don't want the TextBox. If you do want a TextBox, then you should add it to your ASPX file and assign to id the same ID attribute value with the AssociatedControlId value at your label.

Categories : C#

Labelling a grid using n labels, where every label neighbours every other label
You can experiment with a simple greedy algorithm. I don't think that I'm able to give you a strict mathematical prove, at least because the question is not strictly defined, but the algorithm is quite intuitive. First, if you have 1...K numbers (K labels) then you need at least K*(K-1)/2 adjacent cells (connections) for full coverage. A matrix of size NxM generates (N-1)*M+(M-1)*N=2*N*M-(N+M) connections. Since you didn't mention what you understand under 'smallest matrix', let's assume that you meant the area. In that case it is obvious that for the given area the square matrix will generate bigger number of connections because it has more 'inner' cells adjacent to 4 others. For example, for area 16 the matrix 4x4 is better than 2x8. 'Better' is intuitive - more connections and more c

Categories : Algorithm

UIButton title label transform cuts off label
The titleLabel property is primarily used to configure the text of the button, not its bounds. I don't think you can achieve what you want to achieve. If I understand you correctly, you make a button with a small width and big height in interface builder, then set the transformation on the label of the button to 90º, and then expect the button to behave as if the width became the height and vice versa. I suppose you could still set the button in interface builder, but make it horizontal, as if it's rotated -90º, and then set the transformation on the UIButton in viewDidLoad

Categories : Iphone

allow user to tap label and then tap buttons to edit label.text?
To know which UILabel has been touched add a tap gesture to each label which triggers an action. In that actions store which label has been touched in e.g. a property. For the buttons, just connect them to action methods (could also be a single one), inside these methods do your calculation and updated the label indicated by the property described above.

Categories : IOS

iOS 7: Misplaced View Frame for "Label - Label" will be different at run time
I had the same issue and I get below response form Apple: You need to update the constraints to match the frames of these views. I did the following: Editor -> Resolve Auto-Layout Issues -> Clear all constraints in ** view controller then I reordered my objects again in the view. PS: Try Enrico's solution first.

Categories : IOS

New to WPF and Databinding
Please check following links. Hope it helps. http://msdn.microsoft.com/en-us/library/aa480226.aspx http://www.codeproject.com/Articles/24192/Simple-Demo-of-Binding-to-a-Database-in-WPF-using

Categories : Wpf

Separate CSS for label checkbox to label input
You could write your css selector like this: label[for=Username] label[for=Live] You may also have a look at this thread: CSS Selector for selecting an element that comes BEFORE another element?

Categories : HTML

What is the difference between =label and [label] in ARMv6 assembly?
ldr r0,=something ... something: means load the address of the label something into the register r0. The assembler then adds a word somewhere in reach of the ldr instruction and replaces it with a ldr r0,[pc,#offset] instruction So this shortcut ldr r0,=0x12345678 means load 0x12345678 into r0. being mostly fixed length instructions, you cant load a full 32 bit immediate into a register in one instruction, it can take a number of instructions to completely load a register with a 32 bit number. Depends heavily on the number. For example ldr r0,=0x00010000 will get replaced by the gnu assembler with a single instruction mov r0,#0x00010000 if it is an ARM instruction, for a thumb instruction though it may still have to be ldr r0,[pc,#offset] These ldr rd,=things are a shortc

Categories : Assembly

Align Label and value like Label and Input with BootStrap
Bootstrap seems to expect form controls within class="controls" elements. It's a bit hacky but adding the following css rule should work div.controls p { margin-top:5px; }

Categories : CSS

why is it not assigning the string to the label? or how do i get the value out of the array into the label?
cowid is clearly null here so has not been initialized. stringWithFormat shows this with the (null). You can have the confirmation by if (detalles.Cowid == nil) { NSLog(@"The Cow has no id"); }

Categories : IOS

Align 6 elements at 1 line (Label+Input, Label+Input, Label+Input)
If this is your raw HTML: <form action=""> <p>First Name</p> <input type="text" name="fname" /> <p>Middle Name</p> <input type="text" name="mname" /> <p>Last Name</p> <input type="text" name="lname" /> <p>Age</p> <input type="text" name="age" /> <p>Gender</p> <select name="gender"> <option value="male">Male</option> <option value="female">Female</option> </select> <p>Phone Number</p> <input type="text" name="fname" /> </form> You can use CSS to style the page. Check out this link. It utilizes CSS to create 2 rows ('walls') with 6 columns ('panels') in each row. http://jsfiddle.net/chiperific/kFr4h/ If y

Categories : HTML

Using ASPxGridView DataBinding
You can simple do it in the markup as below: Text='<%# Server.HtmlEncode( (string) Eval( "text" ) ) %>' /> Refer: How to use HtmlEncode with TemplateFields, Data Binding, and a GridView <%: %> Syntax for HTML Encoding in a repeater HtmlEncode and Bind Description ASP.NET "special" tags If you want it to access the label control and then use the grid HtmlRowCreated event then you can modify the text.. Refer below link... Find controls in a dataitemtemplate of ASPxGridView column ASPxGridView - How to find a control in grid DataItemTemplate - using DataBoundEvent event example Protected Sub ASPxGridView1_DataBound(sender As Object, e As System.EventArgs) Handles ASPxGridView1.DataBound Dim y As Integer = 0 Dim x As Integer = Me.ASPxGridView1.

Categories : HTML

Listbox Databinding in wpf
try this Create DataTemplate in resource section and then assign it to listbox <Grid.Resources> <DataTemplate x:Key="userNameTemplate"> <TextBlock Text="{Binding Path=UserName}"/> </DataTemplate> <ListBox Name="listBox" ItemsSource="{Binding}" ItemTemplate="{StaticResource userNameTemplate}"/>

Categories : C#

WPF Databinding between two usercontrols
I've removed not important properties to highlight the main: <ListBox Name="TemplateList" ItemsSource="{Binding Source={StaticResource viewModel}, Path=TemplateNames}" SelectedItem="{Binding Path=SelectedTemplate, Mode=OneWayToSource}" /> Note, that you will need SelectedTemplate property with public setter of type TemplateName - the same type that is used for single element in the TemplateNames collection in the ViewModel. In that setter you could pass the value to whatever other view-models you need.

Categories : Wpf

$rootScope's databinding could not get the right value
You need to inject $scope rather than $rootScope into the controller like this controller('testCtrl', ['$scope', testCtrl]); AngularJS creates a child scope automatically when compiled HTML template is executed. So the ng-model used in the template is in child scope. Since you tried to access the data in the controller, you have to access to the the same child scope as the template.

Categories : Angularjs

Databinding a Textblock in WPF
Use the BindingOperations class. Something like this. BindingOperations.SetBinding(myTextBlock, TextBlock.TextProperty, new Binding("Whatever")) Without knowing more about what you're trying to bind, this is the best answer you'll get. And it's almost always better to use a real MVVM pattern rather than to do this sort of thing in codebehind.

Categories : Wpf

WPF databinding equivalent in other technologies
Other frameworks support their own versions of data binding or notification. For example, iOS supports Key-Value Observing, and Qt supports QML Bindings. Unfortunately, there is nothing built-in with Android that provides this functionality.

Categories : Wpf

Databinding custom objects
Assuming that you want to display the address of the selected Employee in the second ListBox, the following should work. <ListBox Grid.Row="1" Name="listAddress" Height="180" Width="190" Canvas.Top="5" Canvas.Left="400" ItemsSource="{Binding ElementName=lstEmployee, Path=SelectedItem.Address}"/> Note: I have assumed that the public property name for the backing field private List<string> _address; is Address

Categories : Wpf

WPF: Change databinding while using MVVM
Have you thought of making the object based on an Interfaced object. The interface basically creates a contract stating that anything derived from it must have whatever it has declared at a minimum... derived controls can have more, but at a minimum the things you want. For example. public interface IPersonProperties { string PersonName { get; set; } int Age { get; set; } // if you want a function that is common between them too bool SomeCommonFunction(string whateverParms); etc... } public class Man : IPersonProperties { // these required as to support the IPersonProperties public string PersonName { get; set; } public int Age { get; set; } public bool SomeCommonFunction(string whateverParms) { doSomething; return true; } // you can stil

Categories : C#

DataBinding on properties with no setter
bind in xaml: <PasswordBox Text="{Binding SecureString, Mode=OneWay}"... if you don't want it changed from xaml binding public string SecureString { get { return _secureString;} private set { if(_secureString == value) return; _secureString = value; RaisePropertyChanged(() => SecureString); } public void SetSecureString(string newSecureString) { SecureString = newSecureString; } the consumer of your ViewModel should be able to set SecureString though that method..

Categories : C#

WPF TreeView Databinding to subset of XML
Assuming you're using an XmlDataProvider to bind the control to the XML, you should be able to set the XPath property to filter the results. <XmlDataProvider x:Key="FilesystemXmlData" Source="source.xml" XPath="Section[@name='Filesystem']/Tree" /> You can then use a HierarchicalDataTemplate to bind your data to the tree. There's a simple example in this CodeProject article.

Categories : C#

Databinding to a Hidden Aspxcombobox?
When you hide column with visible=false it will not render that in HTML so you can't use above function. So instead of visible false use style property with display: none <style> .hiddencolumn {display:none;} </style> <asp:GridView ID="GridViewHotel" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="LnkHotelID" ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hiddencolumn" /> </Columns> </asp:GridView> Now you can use your code.

Categories : C#

KnockOut JS Databinding clarification
You're including the data-bind attribute incorrectly. Don't use :=, simply use = as you would any other HTML attribute. Fixed code: <p>First name: <strong data-bind="text: firstName">todo</strong></p> <p>Last name: <strong data-bind="text: lastName">todo</strong></p>

Categories : Knockout Js

Ext.net databinding extention method
You can use the Renderer tag on your column <ext:DateColumn Header="Started time" DataIndex="DateStarted" Format="yyyy-MM-dd HH:mm:ss" > <Renderer Fn="myRenderer" /> </ext:DateColumn > Call a Direct Method or implement your extension method in JavaScript var myRenderer = function (value, metadata, record, rowIndex, colIndex, store) { return stuff here; };

Categories : Misc

c# winforms datagridview databinding
Maybe like this .. In VB When you have this .. Private bindingSource1 As New BindingSource() Private dataAdapter As New SqlDataAdapter() Dim table As New DataTable() And doing this Me.dataAdapter.Fill(table) Me.bindingSource1.DataSource = table Then user made some changes in your bindingsource then don't forget Me.dataAdapter.Update(CType(Me.bindingSource1.DataSource, DataTable))

Categories : C#

Databinding on multiple levels
You can use the TreeView of WPF. HierarchialDataTemplate will help you here. for a simple exmaple see MSDNenter link description here <HierarchicalDataTemplate DataType = "{x:Type src:League}" ItemsSource = "{Binding Path=Divisions}"> <TextBlock Text="{Binding Path=Name}"/> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType = "{x:Type src:Division}" ItemsSource = "{Binding Path=Teams}"> <TextBlock Text="{Binding Path=Name}"/> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type src:Team}"> <TextBlock Text="{Binding Path=Name}"/> </DataTemplate> This shows you a 3 level hierarchy. League Division Team The key is to

Categories : C#

How can I copy the databinding from one control to another?
If your Binding is simple (doesn't have any Format and Parse event handler registered), you can do a shallow clone like this: public void CloneBinding(Control control, Binding bind){ Binding bind = new Binding(bind.PropertyName, bind.DataSource, bind.BindingMemberInfo.BindingMember); control.DataBindings.Add(bind); } //Use it CloneBinding(ChildControl, ParentControl.DataBindings[0]);

Categories : C#

WPF Code-behind DataBinding Not Working
You have only set the Source of the Binding, but not its Path. The declaration should look like this, using the mainWindowViewModel instance as Source: Binding frameBinding = new Binding(); frameBinding.Path = new PropertyPath("PageName"); // here frameBinding.Source = mainWindowViewModel; // and here frameBinding.Converter = this; frameBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; frameBinding.IsAsync = true; frame.SetBinding(Frame.ContentProperty, frameBinding); or shorter: Binding frameBinding = new Binding { Path = new PropertyPath("PageName"), Source = mainWindowViewModel, Converter = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, IsAsync = true }; frame.SetBinding(Frame.ContentProperty, frameBinding);

Categories : C#

Rebuild statusbar on the fly with databinding
I was actually able to resolve this now, here is my XAML: <UserControl x:Class="MyCompany.View.StatusBarControl" 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" xmlns:viewModel="clr-namespace:MyCompany.ViewModel" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" DataContext="{Binding StatusBar,Source={StaticResource Locator}}"> <UserControl.Resources> <DataTemplate x:Key="SimpleTextDataTemplate"> <StatusBarItem Width="{Binding Width}

Categories : C#

WPF databinding ToolTips won't get updated
Check if you have correct DataContext. Also see output if you have any binding errors. Also, if you want to control ToolTip enable state from CheckBox (and the check box is in the same context) you may just bind IsEnabled to CheckBox IsChecked (with relative binding) This code works on my machine, see example: <Window x:Class="WpfApplication11.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Width="525" Height="350"> <Grid> <CheckBox VerticalAlignment="Top" IsChecked="{Binding GeneralDisplayTooltipsForPreferencesAndSearchOptions}" Content="Check me!" /> <Button Name="btnCancel" Width="80"

Categories : Wpf

Hierarchical Databinding not working wpf
ive basically found a solution - the DataContext of the child grid is whatever is bound to the parent grid...so that collection that is bound to the parent grid is the one the only the child grid sees...so I just added it to collection of my data context objects...but im curious to find out how to make the entire DataContext visible to the childgrid

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.