combobox

WPF ComboBox - showing something different when no items are bound

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 13:47:58
问题 I have a ComboBox, and i want to change its look when the ItemsSource property is null. When it is in that state, i want to show a TextPanel with the text "Retrieving data" in it, and give it a look kind of similar to the watermarked textbox. I figure to do this i need a ControlTemplate, and a trigger. I have the ControlTemplate here: <ControlTemplate x:Key="LoadingComboTemplate" TargetType="{x:Type ComboBox}"> <Grid> <TextBlock x:Name="textBlock" Opacity="0.345" Text="Retrieving data..."

ComboBox data binding

我怕爱的太早我们不能终老 提交于 2019-12-22 12:52:09
问题 I have a combobox control on form that pull its data (Displays and values) from some datasource. On another side I have table with one row. I want when app is lauching, combobox set selectedvalue or selecteditem to value of one column in above row. And when user has changed combobox it will persist change to row. I have tried to bind SelectedValue to this column, but it doesn't work. Combobox just sets on start to first item. What is problem? EDIT This is a Win Forms project. Here is the

Windows Forms ComboBox DropDown Position

浪尽此生 提交于 2019-12-22 12:43:29
问题 Usually dropdown item start position aligned with ComboBox start position like the image above. But i need to develop ComboBox Control which has the lengthy dropdown item gets aligned in middle.I mean Dropdown item left position should still more left positioned than ComboBox like the image below. Any help would be greatly appreciated. 回答1: Here is an extended ComboBox which have 2 new useful features to let you set the position and size of drop-down: DropDownAlignment : You can set it to

Windows Forms ComboBox DropDown Position

与世无争的帅哥 提交于 2019-12-22 12:43:08
问题 Usually dropdown item start position aligned with ComboBox start position like the image above. But i need to develop ComboBox Control which has the lengthy dropdown item gets aligned in middle.I mean Dropdown item left position should still more left positioned than ComboBox like the image below. Any help would be greatly appreciated. 回答1: Here is an extended ComboBox which have 2 new useful features to let you set the position and size of drop-down: DropDownAlignment : You can set it to

extjs 4 How too keep combobox in grid cell

北战南征 提交于 2019-12-22 12:25:56
问题 I've seen similar questions go unanswered elsewhere. I want to have a combobox in a column with two options (ASC, DEC) in it. I want it to show up in each row, or at least have its value show up when it's not selected. I know that its not a 'good idea' to render a combobox in each row, but in this case I know I will have a maximum of about 20 rows, so it shouldn't be a huge deal. If this can't be done I want to have the selected value from the combobox show. Currently I just have the

How to change the CornerRadius of the Combobox WPF

左心房为你撑大大i 提交于 2019-12-22 11:04:03
问题 I want to use a ComboBox with different CornerRadius , how can I change that simply? I've tried with Style and ControlTemplate , but without any success. 回答1: I don't know if this is simple, but creating a ControlTemplate based on the default ComboBox should do the trick. Here is an example: <Style x:Key="ComboBoxTextBoxStyle" TargetType="{x:Type TextBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <Grid> <Border CornerRadius="5,0,0,5"

WPF DataGridTemplateColumn combobox updating all rows

妖精的绣舞 提交于 2019-12-22 09:19:53
问题 I have this XAML that selects a value from a combobox that the ItemSource is a Enum. The tutorial I used is: http://www.c-sharpcorner.com/uploadfile/dpatra/combobox-in-datagrid-in-wpf/ <DataGrid x:Name="dgProductItem" ItemsSource="{Binding ProductVersion.ProductItems}" <DataGridTemplateColumn Header="Deployment Type" Width="120"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding DeploymentType}"></TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate>

AccessViolationException from a combo: Attempted to read or write protected memory

廉价感情. 提交于 2019-12-22 08:27:57
问题 Users are occassionally getting the above error when using our application (VB.Net, Winforms, using v2 of the framework). I'm not able to reproduce it. The callstack is as follows: : System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc

Cant bind enum to combobox wpf mvvm

不问归期 提交于 2019-12-22 08:27:37
问题 A have read a lot of method about the ways of binding enum to combobox. So now in .Net 4.5 it should be pretty ease. But my code dont work. Dont really understand why. xaml: <Window x:Class="SmartTrader.Windows.SyncOfflineDataWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="SyncOfflineDataWindow" Height="300" Width="300"> <Grid> <StackPanel> <ComboBox ItemsSource="{Binding StrategyTypes}" SelectedItem="

MS Access: Display two columns in combo-box

谁说胖子不能爱 提交于 2019-12-22 05:21:49
问题 Embarrassingly simple question but I can't work it out or find the answer via google. Got something like this with two colums But when selected it only displays one column, making the information much harder to read/ understand. Tried changing properties in property sheet (such as column number) but to no apparent effect. 回答1: It depends to a certain extent on what you are doing, often something like this suits: SELECT Id, Surname & ", " & Forename from Table In other words, the bound column