combobox

Model-View-Presenter模式之 Step by Step

拜拜、爱过 提交于 2019-12-29 09:48:14
长 期以来,一直在C/S的世界里埋头苦干,偶尔会有朋友问我为什么没转向Web。我想,暂时的,除了架构与模式,我还没有额外的时间和精力。但归根结底,无论C/S亦或B/S,Server才是最让我着迷的部分。其中,UI无关的设计一直是分层架构方案的重要组成。它和无关持久化PI(Persistence Ignorance)一样,可以让我们把UI呈现相对独立出来,与应用层和领域模型脱耦。简单地说,就是可以把一个基于WinForm实现的UI换成ASP.NET等Web形式的,或者同时支持窗口与报表两种UI形式,而不影响其他层的实现。 具体到实践中,MVC模式( Model-View-Controller )已经成为了UI无关设计的经典,在企业架构中得到广泛应用。Model维护业务模型与数据,View提供呈现,Controller控制程序流程、传递和处理请求。本质上,这是一种Observer模式的具体实现。但是,MVC如此普及,却并非完美。它也有缺点,其中包括View可以直接访问Model,View中耦合了一部分业务对象转换的逻辑。即便是常见的ASP.NET的MVC,也不是一种纯粹的MVC,因为在ASP.NET的结构里,并没有一个严格的、独立的领域模型。 于是,MVP( Model-View-Presenter )逐渐步入了我们的视野。在领域驱动设计的方式下,作为系统核心的领域模型层

jquery combobox behind embedded object (IE only)

蓝咒 提交于 2019-12-29 09:24:30
问题 In Internet Explorer, I have a jquery combobox which opens behind an embedded object (for example a pdf document). How can I make sure the combobox is always in front of the embedded object? See this fiddle for an example: http://jsfiddle.net/RDd3A/258/ (updated fiddle containing my attempts to solve it) HTML: <select id="combobox"> <option value="">Select one...</option> <option value="23">Really long stuff that might wrap</option> <option value="25">Normal Stuff</option> </select> <br/>

How to use update source trigger on Wpf Combobox which is editable?

浪子不回头ぞ 提交于 2019-12-29 08:54:10
问题 I have a combo box (in my wpf-mvvm app). I have set IsEditable = true . But the "property changed event" is getting fired when I start typing. How can I set UpdateSourceTrigger = Propertychanged here ? Also..I need to call a validation function if user has entered new value ( i mean other than those available in list ..using edit functionality). Any help will be appreciated. <ComboBox ItemsSource="{Binding Path = PlanTypeBasedContractNumberList }" Width="90" IsEditable="True" SelectedValue="

Styling WPF ComboBox items

社会主义新天地 提交于 2019-12-29 08:27:33
问题 I have a very simple WPF application which displays a ComboBox which binds to a list of classes which represent people. Each 'Person' object has a Name string field, and a Sex enum. I would like the ComboBox to display a drop-down of the various people's Name field, but for each line to be styled according to the Sex field, for example, blue for males, pink for females. Can anyone tell me what I am doing wrong? Here is the XML: <Window x:Class="ComboBoxColour.MainWindow" xmlns="http://schemas

Auto-Completion In wxPython wxComboBox

此生再无相见时 提交于 2019-12-29 07:37:27
问题 I've been trying to make a ComboBox which would suggest options as you type, much like an IDE's code suggestions/code-sense, or googles suggestions when you type in a search. The suggestions would be the items from the ComboBox dropdown, which contained the substring typed in the text box of the ComboBox. I've tried to make a ComboBox do it, with no luck, I've tried the masked ComboBoxes, and have even tried to subclass the ComboCrtl, but I've always run into troubles either performance wise

javafx create ComboBox TableCell

£可爱£侵袭症+ 提交于 2019-12-29 07:31:36
问题 I'm trying to create a custom TableCell in my TableView. I'd like it to display a ComboBox where I can choose a String value, and then display the String value as if it was an user input. The idea is that ths user doesn't know which are the allowed values so he can simply pick one of them in the ComboBox. I tried to do that making my own "ComboBoxCell" but it doesn't work as expected : public class ComboBoxCell extends TableCell<ClassesProperty, String> { private ComboBox<String> comboBox;

Can a WPF ComboBox display alternative text when its selection is null?

﹥>﹥吖頭↗ 提交于 2019-12-29 01:36:41
问题 G'day! I want my WPF ComboBox to display some alternative text when its data-bound selection is null . The view model has the expected properties: public ThingoSelectionViewModel : INotifyPropertyChanged { public ThingoSelectionViewModel(IProvideThingos) { this.Thingos = IProvideThingos.GetThingos(); } public ObservableCollection<Thingo> Thingos { get; set; } public Thingo SelectedThingo { get { return this.selectedThingo; } set { // set this.selectedThingo and raise the property change

C# Set combo item with selectedValue

帅比萌擦擦* 提交于 2019-12-28 22:08:03
问题 I am dynamically creating a combobox like this: public Control GenerateList(Question question) { // Get a list with answer possibilities List<QuestionAnswer> answers = question.GetAnswers(); // Get a collection of given answers Collection<QuestionnaireAnswer> givenAnswers = question.GetFilledAnswers(); ComboBox cmb = new ComboBox(); cmb.Name = "cmb"; cmb.DataSource = answers; cmb.DisplayMember = "Answer"; cmb.ValueMember = "Id"; // Check an answer is given to the question if (givenAnswers !=

ComboBox has its old value after Clear()

人走茶凉 提交于 2019-12-28 17:57:39
问题 I have two comboBox cb_Brand and cb_Model on a winForm. cb_Model populates values on brand Select. the problem is: if we select the brand any and select the any model under that brand, cb_Model does not loose the value of previous model selected. for example: If we select the brand Audi and model A3 and the select the Brand Ford, when I click on cb_Model to select the model, it displayed the A3 as selected model, but still other models in list are belong to ford. my code is: private void cb

How to filter the DataGridView using ComboBox

北城余情 提交于 2019-12-28 07:07:09
问题 I need help on filtering my DataGridView using ComboBox Here's my display code cm = new SqlCommand(); cn = new SqlConnection(lgn.connections); cn.Open(); cm.Connection = cn; query = "Select * from Trails"; cm.CommandText = query; SqlDataAdapter dar = new SqlDataAdapter(cm); DataTable dt = new DataTable(); dar.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.Columns[0].Width = 0; dataGridView1.Columns[1].Width = 130; dataGridView1.Columns[2].Width = 100; dataGridView1.Columns[3].Width =