w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
VB.NET data-bound combobox doesn't update correctly
Make sure that the radio button list is set to AutoPostBack = True and make your sub handle CheckChanged. You will then have to check each radio button to see if it is selected and filter the data being supplied appropriately.

Categories : Vb.Net

How to programmatically add a row to a datagridview when it is data-bound?
Create a class that corresponds to the data you want to display in your grid (same properties) In your data-binding function, get your query result, but put the result in a list (or any IEnumerable that suits you and the data binding) Create and add another object to your list according to your needs Bind the list

Categories : C#

What is normally bound to a wpf combobox
Set the DisplayMemberPath on your Combobox to the property of the underlying object you want to display. So assuming you have an object like this: Public Class Animal { string Name {get;set;} int Number {get;set;} } You would set your DisplayMemberPath to Name. Else check out this link for a more complete answer: Binding WPF ComboBox to a Custom List

Categories : Wpf

ComboBox with bound DisplayMember and ItemTemplate
So you're trying to get the SomeProperty value into ContentControl.Content? Try this: StackOverflow WPF Combobox DisplayMemberPath You won't be able to set the same property twice, which appears to be what you're doing. Basically, remove the DisplayMemberPath from: <ComboBox DisplayMemberPath="{Binding SomeProperty}".... And set <ComboBox.ItemTemplate> <DataTemplate > <StackPanel Orientation="Horizontal"> <Rectangle Width="5" Height="5" Fill="Red" /> <TextBlock Text="{Binding Path=MyColumn}"/> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate>

Categories : C#

WPF ComboBox Bound List set on DropDownOpened Event
The following change (suggested by Abe Heidebrecht) fixed the problem, but I don't know why. Anyone willing to lend an explanation? WPF: <ComboBox DropDownOpened="deviceSelector_DropDownOpened" Name="deviceSelector"/> C# code-behind: private void deviceSelector_DropDownOpened(object sender, EventArgs e) { var dev = new List<String>(); dev.Add("Device 1"); dev.Add("Device 2"); deviceSelector.ItemsSource = dev; }

Categories : C#

Combobox bound but does not show the values correctly
If you want to use "WhistlerBlue" style you should define ItemTemplate: ... <ComboBox x:Name="routesCmbx" Canvas.Left="10" Canvas.Top="32" Width="127" ItemsSource="{Binding RoutesCollection}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Code}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> ...

Categories : Wpf

WPF bound ComboBox with CompositeCollection - setting SelectedItem
You should be able to fix this with a custom valueconverter for your SelectedItem binding. http://wpftutorial.net/ValueConverters.html should give you some pointers. I'm not sure if combox wants a simple string or some composite object but you can check that. Something like public class ComboConverter: IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value == null) return "<Select>"; return value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value.toString().Equals("<Select>") return null; return value; } should

Categories : Wpf

Setting a default TEXT value to a combobox bound to a numeric value
Not necessarily the "cleanest" solution but you can add a record on your table that is bound and set that as your default value e.g. ID Value -- ----- 1 "Select Item" 2 "Item 1" 3 "Item 2"

Categories : Ms Access

ComboBox not updating when object added to bound list
Well, it doesn't work that way. The inner List<T> has no change notification mechanism, so adding directly to inner List<T> will not generate any change notification that would eventually reach the combo box. Most convenient way to do what you want is adding the item through the BindingList<T> instead.

Categories : C#

vb.net Combobox resets to un-selected on lost focus when bound to Objectdatasource
Try giving it a Causes Validation value of False. If that doesnt work maybe your ComboBox DropDownStyle isnt set to DropDownList add the following property to your combobox in the code ahead and try that CausesValidation="false" or try adding this in your code behind for the dropdownstyle ComboBox.DropDownStyle = ComboBoxStyle.DropDownList

Categories : Vb.Net

WPF: Combobox losing selected index after bound ItemSource collection changes
This statement is wrong I could accept this if I wasn't using the SelectedValuePath binding, but because I am You are not binding to SelectedValuePath. You are binding to a collection of Objects. SelectedValuePath is just for reporting has nothing to do with comparing objects for equality. DisplayMemberPath is just for reporting has nothing to do with comparing objects for equality. You confuse SelectValuePath with SelectedItem. ComboBox does not use SelectedValuePath to determine if two objects are equal. From the documentation of SelectedValuePath: Gets or sets the path that is used to get the SelectedValue from the SelectedItem. In the sample that confuses you you are loading the same objects back in. I am going to assume SelectedValuePath is a property named

Categories : C#

Windows form freezes when bound combobox selection is made
A lot of times this happens because there is a problem in the binding. Are you sure it's not binding the text value of the control(the combobobox) to the data? The correct way to bind (under DataBindings, Advanced) was to bind it to the SelectedValue instead of Text. Please let us know a little bit more how your combobox is binded.

Categories : Vb.Net

Programmatically add container-bound trigger to Docs
There is no current way to do this for a programmatically create a trigger against a existing document. Please log an enhancement in the issue tracker. One workaround for now would be to make a copy of a "template" document that has the necessary scripts associated with it so that when you clone it the onOpen runs on that document and you get the necessary behavior. Here is an example document that when you make a copy you should get a new menu. You can make a copy programmatically using the DriveApp API with the makeCopy function that is documented here

Categories : Google Apps Script

Formatting a data bound control according to bound data
If you want to play with DataBindings without using CheckedChanged event, here is the solution: Binding bind = new Binding("Checked", bindingSource5, "SchoolContacted"); bind.Format += (s,e) => { e.Value = (int)e.Value == 1; dataRepeater.ItemTemplate.BackColor = ((bool)e.Value) ? Color.Red : Color.White; }; cbSchoolFri.DataBindings.Add(bind); I'm not sure if your dataRepeater.ItemTemplate has a DataBindings property so that we can use dataRepeater.ItemTemplate.DataBindings?

Categories : C#

How to close window programmatically after calling window.showdialog?
When you launch the dialog using ShowDialog, the control goes to the newly opened dialog. So you need to do the close operation in the launched dialog. Alternatively, you can try window.Show(); Thread.Sleep(10000); window.Close(); DoEvents();

Categories : C#

Programmatically Binding ComboBox(s) By Control Name
I suppose that the guisp_XXXXXX are names of stored procedures. If this is the case then you cannot use them in that way to fill a datatable using a SqlDataAdapter. Instead you need to build a SqlCommand, specify that its CommandType is StoredProcedure and assign that command to the SelectCommand property of the SqlDataAdapter using (var con = new SqlConnection(ConStr)) { try { con.Open(); var adapter = new SqlDataAdapter(); var cmd = new SqlCommand(dd.Value, con); cmd.CommandType = CommandType.StoredProcedure; adapter.SelectCommand = cmd; adapter.Fill(dt); ......

Categories : C#

Populate a second combobox with data from the first combobox and a comma-delimited file
bind the first combobox the way you are doing. trap the combobox SelectedValueChanged event. use theSelectedValue property, do a second pass on the file. This time add values to the different hashset like this: Dim ages = New HashSet(Of String) Using reader = New Microsoft.Visua... ...FieldParser("C:here.txt") reader.TextFieldType = Micros... ....eldType.Delimited reader.Delimiters = New String() {","} Dim currentRow As String() While Not reader.EndOfData Try ' v--- THIS LINE IS IMPORTANT ---v if currentRow(0).ToString() = combobox1.selectedvalue then ages.Add(currentRow(1).ToString()) end if you get the idea ' bind data to combo box (or use Items.Add instead

Categories : Vb.Net

C++ How do i hide a console window on startup
So i wanna know why it opens a new console, instead of just only create and hide the first one. A console application doesn't actually create a console itself, it just runs in one. If you run the executable from Explorer, Windows creates a console for it to run in. When you call FreeConsole, it doesn't close the new console, simply detaches your process from it. As WhozCraig noted in the comments, create a regular Windows application and don't create a window.

Categories : C++

Select other window in Emacs at startup
Put the following in your ~/.emacs file: (add-hook 'emacs-startup-hook '(lambda () (select-first-buffer-in-list command-line-args))) (defun select-first-buffer-in-list (list) (let (buffer) (while list (if (setq buffer (get-file-buffer (car list))) (progn (select-window (get-buffer-window buffer)) (setq list nil)) (setq list (cdr list)))))) It will check which of the command line parameters correspond to a buffer. It selects a window displaying the buffer of the first such parameter.

Categories : Emacs

Filter on combobox based on another combobox with same table data in c#
You're looking for filtering like state/city (as an example), correct? So if someone picks a state in the first combo box, then you want a list of cities within that state to populate in the second combo box. Correct?

Categories : C#

emacs24 losing window frame on startup
I assume you are starting Emacs with no init file, i.e., emacs -Q, right? If so, then this is a bug. Please report it in that case: M-x report-emacs-bug. If you see the problem not with emacs -Q but only with your startup file, then find out which part of your init file introduces the problem. To do that, bisect the file recursively (comment out 1/2, then 1/4, then 1/8,...). You can use command comment-region to comment or (plain C-u) uncomment large sections of the buffer.

Categories : Linux

how to set startup uri property to another window in folder in wpf project
When you have folders in your project structure, you should use a "/" not a ".", so it's foldername/window.xaml. (I hope it's not actually called window.xaml by the way. That's a confusing name for a type in a WPF project, because there's a built in type called Window.) Setting the build action to Resource will make matters worse: not only were you using the wrong name, you've now changed the build action to the wrong one for XAML. The correct build action for a .xaml file is usually Page. (App.xaml is an exception to that rule.) The Page build action causes the page to be compiled into a binary representation (known as BAML), and that binary format can then be loaded either by the call to InitializeComponent in the codebehind, or through Application.LoadComponent. Setting the build act

Categories : Wpf

How can we remove startup entry from msconfig window?
The entries are stored in the registry. This is how you should add and remove entries: using Microsoft.Win32; private void SetStartup() { RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true); if (ShouldAdd) rk.SetValue(AppName, Application.ExecutablePath.ToString()); else rk.DeleteValue(AppName, false); } here is a list of different entries: http://stackoverflow.com/a/5394144/2027232 To get admin rights you need to add a manifest file to your app: Ctrl+Shift+A (add new item), then select (Aplication manifest file) Open the manifest file and change the line: <requestedExecutionLevel level="asInvoker" uiAccess="false" /> to <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&g

Categories : C#

Combobox DataBinding Bug - Won't write value if programmatically losing focus
I can't honestly answer questions 1 and 2, but I can give you this to answer question 3. You didn't do anything terribly wrong, just didn't include a helpful line of code. Add the following line to FormLoad: ComboBox1.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged I tested this out in Visual Studio 2010 and the label updates properly when a new value is selected from the combobox.

Categories : Vb.Net

Handling WM_NCACTIVATE in startup window blocks all other windows
The solution to keeping the visual style of a WPF window to active even if the window loses focus is to handle the WM_NCACTIVATE like this: private const uint WM_NCACTIVATE = 0x0086; private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { var returnvalue = IntPtr.Zero; if (msg == WM_NCACTIVATE) { //replace the wParam (true/false) which indicates //active/inactive with always true returnvalue = DefWindowProc(hwnd, WM_NCACTIVATE, new IntPtr(1), new IntPtr(-1)); handled = true; } } [DllImport("user32.dll")] static extern IntPtr DefWindowProc(IntPtr hWnd, WindowsMessages uMsg, IntPtr wParam, IntPtr lParam);

Categories : C#

How to disable master password window on netbeans startup?
The solution appeared to be simple. A missing package was preventing Netbeans from using Gnome Keyring. So install libgnome-keyring-dev sudo apt-get install libgnome-keyring-dev

Categories : Ruby On Rails

Datagrid bound list not being updated visually from Popup Window event wpf
Without more information, I would guess that it is indeed a focus issue. Try using a standard MessageBox instead. It should keep your focus a lot tighter than a window and allow your code to execute entirely within DeleteEverything(). You can use the MessageBoxResult to determine whether or not to actually delete everything inside DeleteEverything() after MessageBox.Show("blahblahblah") has returned.

Categories : Wpf

Refresh combobox list from other window, MVVM
If I understand problem correctly - you want to get a new guest from child window and update your collection in parent window - then there are many ways to do it. For example: Add event "OnSuccessful" to your GuestsViewModel and then attach BookingsViewModel. Implement EventAggregator pattern (subscriber - listener) Just refresh guests after closing child window (show it as a modal dialog).

Categories : C#

Combobox binding not working when window is in grid container
It looks like it is your RelativeSource on the Binding. Since you are binding to a specific Window class - in this case it looks like GetType() will return typeof(winListOrgane). If you change that to typeof(Window), it should work: b.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(Window), 1);

Categories : Wpf

combobox selection won't load/initialize class in a new window
UPDATE: Based on your feedback, it seems you are trying to achieve the following: Use the code of an existing Applet (found here) in a Desktop application (i.e. in a JFrame). Converting an Applet to a Desktop application is an "undertakable" task, the complexity of which depends on how much "Applet-specific" stuff is used by the Applet. It can be as simple as creating a JFrame and adding myFrame.setContentPane(new myApplet().getContentPane()); or as complex as...hell. This tutorial might be a good place to start. After taking a look at the Applet at hand, it seems to be fairly easy to convert it. The only complicating factor is the use Applet's methods getCodeBase() and getImage(URL) (somewhere in the code). These two methods result in a NullPointerException if the Applet is not depl

Categories : Java

Combobox Dropdown event triggers parent window Z index to change
I have been in your situation before... you have an unexplained problem... it doesn't make any sense... you've tried everything that you can think of... in a last ditch effort to fix the problem, you throw it out to all the experienced users here... then nothing... no responses... no help. The thing is that if you can't find and fix the problem with all of your code right in front of you, then how can we fix it without any code? All I can suggest is for you to try to locate exactly where the problem originates. You can do this by commenting out sections of code and then running your solution to see if that has removed the problem or whether it still exists. The fact that your problem only occurs infrequently will make this stage even more tricky. However, with perseverance, you should b

Categories : Wpf

filter combobox value based on another combobox but at runtime combobox 2 is empty
Since you clear the ComboBox Items collection in "PopulateMachines" you have to add the item again private void cboMachineGroup_SelectedIndexChanged(object sender, EventArgs e) { //this.cboMachines.Text = ""; PopulateMachineList(); cboMachines.Items.Insert(0, "-ALL MACHINES-"); cboMachines.SelectedIndex = 0; } Second Try: private void btnShowForDateRange_Click(object sender, EventArgs e) { tblDateRange = new DataTable(); this.btnShowForDateRange.Enabled = false; this.btnFindVRM.Enabled = false; this.progressBar1.Visible = true; btnExport.Enabled = false; cboMachines.Items.Insert(0, "-ALL MACHINES-"); cboMachines.SelectedIndex = 0; string[] parameters = { dtStartDate.Value.ToString("yyyy-MM-dd"), dtEndDate.Value.ToString("yyyy-MM-dd"), t

Categories : C#

How can I programmatically open Powerpoint without seeing the window?
objPPT.Presentations.Open inputFile,,msoFalse It needs another comma objPPT.Presentations.Open inputFile,,,msoFalse The parms are: Presentations.Open "filename", boolReadOnly, boolOpenUntitled, boolWithWindow You're telling it to open the input file, read-only, not untitled and leaving the WithWindow parm at its default value (True) which opens WITH a visible window. Bear in mind that you can't write any code that selects anything (that requires a visible window), but since you're not doing this, you should be good to go. [APPENDED EDITS] Ansgar's correct (apologies for my earlier mistaken comment). We're not allowed to invoke PPT invisibly, BUT if you create/open a presentation windowlessly, PPT never appears. I'm not familiar enough with VBS scripting to work out the exact

Categories : Vbscript

How do I programmatically add a statusbar to an WPF Window application using C#
http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.statusbar.aspx Heres how to use Statusbars in WPF. Learning XAML will really help you even if it is a bit tedious.

Categories : C#

Programmatically Maximize Window On Half Of Screen
This can be done without p/invoke. Try this: Rectangle rect = Screen.PrimaryScreen.WorkingArea; rect.Width = rect.Width / 2; Bounds = rect; This will put the current window on the left of the primary screen. Then just add this to put it on the right of the screen. Location = new Point(rect.Width, 0);

Categories : C#

Does d3js data binding clone the data being bound or store a reference to it?
Yes you can expect them to update. With out more code it is hard to guess but you can use something like this: var els = d3.select("body").selectAll("div");//Cache elements els.style('background','blue')//Change background to blue; els.style('background','red')//Change background to red; els.style("width", function(d) { return d *1/3 + "px"; //Divide elements width by 3 }); DEMO

Categories : Javascript

How to disable "Window animation scale" programmatically on Android 4.0+ devices?
Did you try Activity#overridePendingTransition(0, 0)? Check out the documentation: Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.

Categories : Java

AngularJS load data in app startup
You could manually start Angular.js with angular.bootstrap. So that you can load your data first, then when you feel ready. Call angular.bootstrap() to start angular module. What you have to prepare: Remove ng-app="XXX" from your document. Call angular.bootstrap() after everything is ready. Doc for angular.bootstrap()

Categories : Javascript

print the data on window screen and then clear the window screen before printing other data.in python
In that case, all you have to do is remove the previous content of the widget just before printing the new one. If you have an Entry widget, use the delete method: entry.delete(0, 'end') # print new serial data Or if you have a Text widget: text.delete(1.0, 'end') # print new serial data

Categories : Python

Why does Internet Explorer fire the window "storage" event on the window that stored the data?
Microsoft seems to be aware of the issue, but it doesn't look like they're going to fix it any time soon: https://connect.microsoft.com/IE/feedback/details/774798/localstorage-event-fired-in-source-window One option is that you can design your listeners and setters so that they don't react or store when they get information from a storage event that's already consistent with their state. However, this design pattern can be more difficult than relying on the storage event only firing on other windows. Another option is to make local storage work the same way in IE that it works in other browsers. I came up with an admittedly hacky but functional solution that I tested in IE10 and expect to work in IE8 and IE9. My javascript components don't listen to the window "storage" event directly bu

Categories : Javascript



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