w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
combobox1 to 2 selectedindex
If the second combobox has only 3 items then you will never be able to reach the final else clause where you reset the button to the enabled state. This happens because you use the || logical OR operator and with only three items you will always take one of the else if condition before the final else

Categories : C#

WPF Combobox SelectedIndex Not Working
IT works just fine, if you do it in XAML, I don't see it in your XAML, did you forget? <ComboBox Width="250" HorizontalAlignment="Left" ItemsSource="{Binding Path=FileTypes}" SelectedItem="{Binding Path=FileType, Mode=TwoWay}" SelectedIndex="0"/> Note that only will work initially, then you'll have to reset it again when you need it.. via trigger, or code behind.

Categories : Wpf

selectedIndex UItabBarController not working
Instead of assigning selectedIndex, you should use the selectedViewController property. self.tabBarController.selectedViewController = [self.tabBarController objectAtIndex:3];//or whatever the index the VC you want to select is Also you should not be allocating a tabBarController from the AppDelegate. You need to grab the rootViewController and then grab the instance of your already instantiated tabBarController from there Check out the accepted answer here for an example of how to grab your VC from the appDelegate. How do I access my viewController from my appDelegate? iOS

Categories : IOS

Cannot set prop('selectedIndex') in Firefox
I don't know why it doesn't work, but could you do this instead, which should work: $('select').find('option').first().next().prop('selected','selected'); To get n-th item: index = 1; $('select').find('option:nth-child(' + (index+1) + ')').prop('selected','selected'); Where index is the selectedIndex Are you sure this doesn't work on firefox? Just tested it (firefox 21 on ubuntu) - http://jsfiddle.net/Wmv6q/ Perhaps you have something else on your page that is resetting it? If not, can you tell what version of firefox you are on?

Categories : Javascript

dropdownlist selectedindex not changing c#
It is due to the fact that from ddlTelefonTipi_SelectedIndexChanged all of your casting is on ddlTelefonErisimTipi, which is the wrong DropDownList. Change ddlTelefonErisimTipi to ddlTelefonTipi.

Categories : C#

Enable Textbox on SelectedIndex change
You need to have members in your class that hold references to your DropDownList and other controls that you want to enable/disable. public class YourClass { private DropDownList ddl; private TestBox txa; private void createControls { // ... TextBox txa = new TextBox(); txa.ID = "amtData" + rowcount.ToString(); // ... DropDownList ddl = new DropDownList(); ddl.Items.Add("No Change"); // ... etc. } void ddl_SelectedIndexChanged(object sender, EventArgs e) { if (ddl.SelectedIndex == 1) txa.Enabled = true; } }

Categories : C#

selected to retrieve all dropdowns which has same selectedindex value
You can use a filter function: var editSelects = $("table tr select").filter(function() { return $(this).find("option").text() == "Edit"; //This should be value, but for your code, its text() }); Also, per @JasonP comments, your ID's must be unique.

Categories : Jquery

How to check RadTabControl's SelectedIndex null or not in WPF
Why you need to check the SelectedIndex for, why not SelectedItem? To answer your question, SelectedIndex is of type int so the default value of SelectedIndex for TabControl should be -1/0 depending on the control that you are using. Thus, you cannot do obj.SelectedIndex != null, you can do obj.SelectedIndex < 0 for check.

Categories : Wpf

How to get DataGrid.SelectedIndex from another ".cs" file?(MVVM)
Your ViewModel will have Properties that are populated Model objects. Here you will assign them so the View will be able to display data. public ParentModel { get { return parentModel; } private set { if (parentModel != value) { parentModel = value; RaisePropertyChanged("ParentModel"); } } } public int SelectedItemIndex { get { return selectedItemIndex; } set { if (selectedItemIndex != value) { selectedItemIndex = value; RaisePropertyChanged("SelectedItemIndex"); } } } The View will contain the object to display data, be it DataGrid, ComboBox etc. You can use Ite

Categories : Wpf

ASP.NET GridView within Scrollable Div: Scroll to SelectedIndex
Some bit of javascript can help. Have a look at the following post: http://stackoverflow.com/a/4558637/145682 Here is a POC: Markup: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GridViewScrollIndex.Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> #form1 { height: 225px; } </style> <script> function focusRow(id, rowIndex) { var tbl = document.getElementById(id); var rows = tbl.childNodes[0].childNodes; rows[rowIndex].childNodes[0].focus(); document.getElementById('console').innerText = rows[rowIndex].chi

Categories : Asp Net

WPF ComboBox with CompositeCollection - SelectedIndex not sticking
Since you're adding to your Collection after the ComboBox is constructed, you may have to dip into the Loaded event and set your SelectedIndex there... <ComboBox Loaded="ComboBox_Loaded"> <ComboBox.ItemsSource> <CompositeCollection> <ComboBoxItem Content="All" /> <CollectionContainer Collection="{Binding Source={StaticResource AllBitsSource}}" /> </CompositeCollection> </ComboBox.ItemsSource> </ComboBox> Code behind: private void ComboBox_Loaded(object sender, RoutedEventArgs e) { (sender as ComboBox).SelectedIndex = 0; }

Categories : C#

SelectedIndex with OneWayToSource binding does not trigger
I think in your case, you must use the mode OneWay. By default, you have used mode TwoWay. Quote from MSDN about TwoWay: TwoWay binding causes changes to either the source property or the target property to automatically update the other. This type of binding is appropriate for editable forms or other fully-interactive UI scenarios. Most properties default to OneWay binding, but some dependency properties (typically properties of user-editable controls such as the Text property of TextBox and the IsChecked property of CheckBox) default to TwoWay binding. A programmatic way to determine whether a dependency property binds one-way or two-way by default is to get the property metadata of the property using GetMetadata and then check the Boolean value of the BindsTwoWayByDefault property

Categories : C#

DropDownMenu.SelectedIndex causing error even though value exists
DataBinding Raised after the control's PreRender event, which occurs after the page's PreRender event. (This applies to controls whose DataSourceID property is set declaratively. Otherwise the event happens when you call the control's DataBind method.) So to set selected inedex of dropdownlist on page load you have to call DataBind() method like this... dropdownlist1.DataBind() After this you can set the index.But if you set before binding than it will give error because there no item in dropdownlist.

Categories : C#

XAML ComboBox default SelectedIndex is not shown
You need to populate combo box items from ViewModel. Moreover you should not use SelectedValue property, instead of it you should use SelectedItem. See the below given code. XAML <ComboBox x:Name="cmb" ItemsSource="{Binding DistanceCollection}" SelectedItem="{Binding Distance, Converter={StaticResource StringToDoubleConverter}, Mode=TwoWay}"/> ViewModel public class viewModel : INotifyPropertyChanged { public viewModel() { DistanceCollection = new ObservableCollection<string> { "1", "10", "100", "1000" }; Distance = double.Parse(DistanceCollection[1].ToString()); } public ObservableCollection<string> DistanceCollection { get; set; } private dou

Categories : Xaml

TabControl.SelectedIndex is not working to switch tab control
On the image that you're using as a button, change MouseLeftButtonDown="SaveFormAll" to MouseLeftButtonUp="SaveFormAll" and try again. That should work. The problem seems to be that your MouseLeftButtonDown handler is firing, but the MouseLeftButtonUp event immediately follows it and puts the focus back on the image, which means the last tab stays active. When I changed it to using MouseLeftButtonUp, it worked.

Categories : C#

Change SelectedIndex of a DropDownList Dynamically added
Your question is not clear. but i guess, your selectedindexchange method of dynamically added control is not working ?. if it is the problem, then to solve it attach postback=true to your dynamically added control. then only it will trigger an event when selected index change occurs.then you can bind a method to selectedindexchange event Edit <option value="" selected="selected">hai</option> <option value="" >hello</option> then the hai will be appeared as seleected

Categories : C#

ListBox SelectedIndex always -1 in slectedindexchanged event handler
You can't databind ListBox2 on every page load. Try: Page_Load()... { if(!IsPostBack) { //databind listbox2 } } Try reading up a bit on the ASP.NET page lifecycle. On the postback, the ListBox2 will have it's correct state due to viewstate. Your current code resets it. Hence the -1.

Categories : C#

Display info on ItemPage WITHOUT using SelectedIndex from ListBox
Instead of capturing the SelectedIndex, get the SelectedItem, which should be an object with the properties FirstName and LastName (likely some class you defined). From there, you can query the database using those values. Something similar to the code below: var listItem = MainListBox.SelectedItem as Person; var table = MobileService.GetTable<Person>(); var serverItem = (await table .Where(p => p.FirstName == listItem.FirstName && p.LastName == listItem.LastName) .ToEnumerableAsync()) .FirstOrDefault();

Categories : C#

How to latch the SelectedIndex on a WPF listbox when a child control has focus
Replace the Trigger with an EventTrigger then IsSelected isn't returning to original state: <EventTrigger RoutedEvent="PreviewGotKeyboardFocus"> <BeginStoryboard> <Storyboard> <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsSelected"> <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0" /> </BooleanAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> From MSDN Unlike Trigger, EventTrigger has no concept of termination of state, so the action will not be undone once the condition that raised the event is no longer true. PS: I have tried this for SelectionMode="Single" only.

Categories : C#

flash app accessing webservice; "security error accessing url". crossdomain in place
<allow-access-from> and <allow-http-request-headers-from> have a not well know attribute secure. This attribute is there specifically to indicate if we authorize secure connections from an insecure domain (ie https from http); and its true by default (connection refused). try with this crossdomain, it may solve your issue. <cross-domain-policy> <site-control permitted-cross-domain-policies="all"/> <allow-access-from domain="*" to-ports="*" secure="false"/> <allow-http-request-headers-from domain="*" headers="*" secure="false"/> </cross-domain-policy>

Categories : Web Services

How to popup dropdownlistbox on selectedindex changed event of another dropdownlistbox in same view using mvc4 asp.net
you will need to do an ajax callback to your controller $('.drop1').change(function(){ //Clear dropdown $('.drop2').html(''); $.ajax({ url: "@(Url.Action("Action", "Controller"))", type: "POST", cache: false, async: true, data: { data: $this.val() }, success: function (result) { //see link for populating dropdown } }); }); see this link for populating a dropdown with ajax result Populating dropdown with JSON result - Cascading DropDown using MVC3, JQuery, Ajax, JSON Hopefully this helps.

Categories : Dotnet

passing selectedindex of one dropdown as an mvc parameter of a second dropdown on same razor view
You need a cascading dropdown plugin, either roll your own and perform a get when the first dropdownlist changes, or use a plugin like this http://www.ryanmwright.com/2010/10/13/cascading-drop-down-in-jquery/

Categories : Jquery

Accessing the key/value of a dictionary
.Equals() is not an assignment operator, but a comparison function. Try letter = " "; If keystrokeDictionary.ContainsKey(letter) Then letter = keystrokeDictionary.Values(letter) End If Return letter

Categories : Vb.Net

Accessing ManagedObjectContext
There are several ways you can share your object context around your app. Note that you'll need to make sure you don't use the context on different threads; you'll have to add some complications if you want to use Core Data in both the background and foreground threads. Which option you use is up to you: I typically move the Core Data objects (persistent store coordinator, managed object model, contexts for foreground and background threads) into a singleton object, so any class that needs it can get the objects without adding much in the way of upward dependencies. You can use dependency injection to pass the context into your view controllers as you create them in your app delegate, and from those view controllers down into other objects that need them. You can expose the Core Data g

Categories : IOS

Accessing Context
Why do you want to gain access to the objects on the main activity? I'm asking because I'm wondering if there's a better architectural decision that could be made. Activities are intentionally modular. If you're looking to update the UI components in MainActivity when receiving the broadcast, you could do the following: Broadcast a message from the broadcastReciverClass and register a receiver in MainActivity to update accordingly. Change data in a shared/singleton class when receiving a message and make the appropriate UI change in MainActivity in the onResume() method.

Categories : Android

Accessing javascript
Have you looked at docs.js included on this page Below is part of this js which manages carousel /* * Slideshow 1.0 * Used on /index.html and /develop/index.html for carousel * * Sample usage: * HTML - * <div class="slideshow-container"> * <a href="" class="slideshow-prev">Prev</a> * <a href="" class="slideshow-next">Next</a> * <ul> * <li class="item"><img src="images/marquee1.jpg"></li> * <li class="item"><img src="images/marquee2.jpg"></li> * <li class="item"><img src="images/marquee3.jpg"></li> * <li class="item"><img src="images/marquee4.jpg"></li> * </ul> * </div> * * <script type="text/javas

Categories : Javascript

MFC: accessing GUI from another thread?
Don't do it. You'll live in a world of ASSERTs and weird behaviour if you do. The GUI works through a system of Windows messages which are 'pumped' on the main thread. If you start modifying the UI in another thread you'll have situations where your operation causes other UI messages, which will be handled by the main thread potentially at the same time you're still trying to access the UI on another thread. MFC programming is hard enough without trying to handle this sort of thing. Instead use PostMessage to put the UI related handling onto the main thread.

Categories : C++

Accessing inner text from XML in C#
This works: XmlNodeList nodelist1 = xml.SelectNodes("my:myFields/my:ProjectDescription"); foreach (XmlNode node in nodelist1) { text1 = node["html"].InnerText; } It converts the tag.innerText to paragraph formatting even in the string text1. You can trim it down from there.

Categories : C#

Accessing an iteration value with JSP
The struts iterator documentation is here. You can use the var attribute to hold a reference to the current iterator element. <s:iterator var="element" value="@com.homeservices.action.utils.StateCode@values()"> // i'm not sure about the whole @... part You can now use ${element} (or #element in struts' tags) to reference each current iteration element. Please don't use scriplets in your jsp. Use JSTL or struts' tag libraries.

Categories : Java

Accessing a specific li within a ul
You need something like var test = "the content to seek"; $('ul.footwear').find('a').filter(function(idx, el){ return $.trim($(this).text()) == $.trim(test); }).closest('li').trigger('click') Demo: Fiddle

Categories : Javascript

Is different way of accessing a java map possible
No. Java is a statically typed language, and Map doesn't have a one member... so this would fail to compile. Use constants for the keys - perhaps enums, even - to avoid the risk of typos, and just use the normal Map methods. Java doesn't provide you any alternatives at a language level.

Categories : Java

accessing value with selenium
I would recommend using xpath in this scenario rather then relying on tagnames; private int getMetalFromFleet(WebElement fleet) { By identifier = By.xpath("td[contains(text(),'Metaal')]/following-sibling::td[contains(@class,'value')]"); return Integer.parseInt(fleet.findElement(identifier).getText()); } Obviously you will want some error handling in there, but hopefully this gives the idea that those loops are not always required, and Xpath isn't always the bogeyman it is made out to be by some. EDIT Just in case anyone is confused, it is okay for the XPath to not have leading slashes if the selector is performed on a WebElement rather than the WebDriver object. You would have to add two leading slashes if this selector was used on the WebDriver object. ED

Categories : Java

Accessing Yellow LED
you missed some thing that leads to show java.lang.IllegalStateException: Connection has not yet been established you are so busy that you are not waiting for a connection :) try { ioio.waitForConnect(); //Note this line //You Code Goes Here } catch (ConnectionLostException e) { } catch (IncompatibilityException e) { }

Categories : Android

Accessing TextBox ID
Your Button1_Click and Button2_Click events would be on two separate postbacks. Box would not have any values assigned to it beyond whatever gets set in the default constructor in this scenario. Edit: Because you're losing the state of all your code-behind objects and values on postbacks.

Categories : C#

Accessing variables within a URL
I ammended this question through the quesry string having "&" the system thought it was the end of the querystring. I chnged this by encoding and decoding my urls with UrlEncode and UrlDecode

Categories : C#

Accessing Database using JSP
Jsp for front end so please avoid database code here solution for you add jar file download mysqlconnecter.jar

Categories : Mysql

Accessing this in other scope
Using jQuery, you can use $.proxy(function, context) $.get('/echo/jsonp', $.proxy(this.success, this); without jQuery, you can use a closure var myContext = this; $.get('/echo/jsonp', function(X) { myContext.success(X); ); or var myContext = this; $.get('/echo/jsonp', function() { myContext.success.apply(myContext, arguments); );

Categories : Javascript

Accessing a list in a map in JSP
You can and should not nest EL expressions. You should see EL ${...} as one big scope where various variables can interact with each other. Just get rid of the nested EL expression altogether. ${generic[objectA][0]} This works provided that the equals()/hashCode() of A isn't broken. See also: Our EL wiki page

Categories : Jsp

Accessing the XML string value
use warnings; use strict; my $VAR1 = [ 'person', [ {}, 0, ' ', 'id', [ {}, 0, 'bEdS5KlaV7' ], 0, ' ' ] ]; print $VAR1->[1]->[4]->[2], " "; __END__ bEdS5KlaV7 See also: perldoc perldsc

Categories : Xml

accessing other tab from one window
As far as I know, this isn't possible. The browser wouldn't allow you to manipulate the browser's lower functions in a regular environment. It would ignore it or show a security error come up.

Categories : Javascript



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