private void Button_Click(object sender, RoutedEventArgs e)
{
Popup1.PlacementTarget = TesTextBox;
Popup1.Placement = PlacementMode.Bottom;
Popup1.IsOpen = true;
} private void TestDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
TesTextBox.Text = (dataGrid.SelectedItem as DataRowView).Row["c_AirStrategyExpCode"].ToString();
}
            dataGrid.ItemsSource = ds.Tables[].DefaultView;
dataGrid.LoadingRow += DataGridOnLoadingRow;
                <StackPanel Orientation="Horizontal" Height="">
<TextBlock Text="ComboBox:" Height="" Width="" />
<Border Height="" BorderBrush="DarkGray" BorderThickness="">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="TesTextBox" Height="" Width=""/>
<Button Height="" Width="" Click="Button_Click" Style="{StaticResource FrameBtnStyle4}">
<Popup x:Name="Popup1" Height="" StaysOpen="False">
<Border BorderBrush="DarkGray" BorderThickness="">
<DataGrid x:Name="dataGrid" GridLinesVisibility = "None" CanUserReorderColumns = "false"
Style="{StaticResource DataGridStyle1}" RowStyle="{StaticResource DataGridRowStyle1}"
CellStyle="{StaticResource DataGridCellStyle1}" ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle1}"
IsReadOnly="True" SelectionChanged="TestDataGrid_SelectionChanged"/>
</Border>
</Popup>
</Button>
</StackPanel>
</Border>
</StackPanel>

自定义ComboBox,简简单单实现的更多相关文章

  1. WPF 自定义ComboBox样式,自定义多选控件

    原文:WPF 自定义ComboBox样式,自定义多选控件 一.ComboBox基本样式 ComboBox有两种状态,可编辑和不可编辑状态.通过设置IsEditable属性可以切换控件状态. 先看基本样 ...

  2. WPF 自定义ComboBox样式

    一.ComboBox基本样式 ComboBox有两种状态,可编辑和不可编辑状态.通过设置IsEditable属性可以切换控件状态. 先看基本样式效果: 基本样式代码如下: <!--ComboBo ...

  3. WPF自定义ComboBox

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}"> &l ...

  4. 【.NET开发之美】使用ComponentOne提高.NET DataMap中的加载速度

    概述 FlexGrid for WinForm 采用了最新的数据绑定技术,并与Microsoft .NET Framework无缝集成. 因此,您可以获得易于使用的灵活网格控件,用于创建用户友好界面, ...

  5. VS2008 工具栏CMFCToolBar的使用总结(转)

    (一)自定义工具栏 自定义工具栏,分两种情况:一是直接添加工具栏,并自己绘制图标:二是,添加工具栏,然后与BMP关联,与VC6.0中的自定义彩色工具栏类似. 1.  自绘工具栏 1)添加Toolbar ...

  6. Qt 组合框QComboBox的定制

    转载:https://www.cnblogs.com/csuftzzk/p/qss_combobox.html 转载:https://www.bbsmax.com/A/E35pLgRK5v/ 转载:h ...

  7. ExtJs基础知识总结:自定义弹窗和ComboBox自动联想加载(四)

    概述 Extjs弹窗可以分为消息弹窗.对话框,这些弹窗的方式ExtJs自带的Ext.Msg.alert就已经可以满足简单消息提示,但是相对复杂的提示,比如如何将Ext.grid.Panel的控件显示嵌 ...

  8. ExtJS基础知识总结:自定义日历和ComboBox控件(二)

    概述 1.ExtJS 5不支持日期选择框中只选择年月,为了满足ExtJs5可以实现选择年月的功能,查询网上资料,整理出来了相应的处理方式,最终实现的效果如下图: 2.ExtJS 控件丰富,如果需要实现 ...

  9. WPF自定义控件与样式(8)-ComboBox与自定义多选控件MultComboBox

    一.前言 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要内容: 下拉选 ...

随机推荐

  1. ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏

    本篇讲解三个工具栏控件.其中Ext.toolbar.Toolbar可以用来放置一些工具类操控按钮和菜单,Ext.toolbar.Paging专门用来控制数据集的分页展示,Ext.ux.statusba ...

  2. 积累的VC编程小技巧之属性页

    1.属性页的添加: 创建对话框的类,该类要从CpropertyPage继承:然后在要添加该对话框为属性页的类(头文件)里创建CpropertySheet类的一个对象m_tabsheet和新创建的对话框 ...

  3. HDU--杭电--4504--威威猫系列故事——篮球梦--DP

    威威猫系列故事——篮球梦 Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total ...

  4. 【iOS】iOS的iTunes文件共享,在程序Document路径

    有时候程序开发须要通过沙盒中的 documents目录与用户共享文件,iTunes默认是不支持iTunes file Sharing的,首先设置 info-list的Application suppo ...

  5. java web从零单排第十六期《struts2》控制标签(2)

    1.s:subset标签概述: s:subset标签功能是从一个集合中取出部分元素合并成一个新的集合,新生成的这个集合是原来集合的子集.属性和意义如下: 属性名 是否必需 默认值 类型 说明介绍 co ...

  6. hibernate级联保存问题,出错not-null property references a null or transient value

    Servlet.service() for servlet default threw exception org.hibernate.PropertyValueException: not-null ...

  7. ifconfig 源码

    贴一下ifconfig的源码(它属于net-tool软件包),以备平时查看网络信息的配置. /* * ifconfig This file contains an implementation of ...

  8. STM32学习笔记2-系统时钟知识及程序配置

    一:基本知识 1.  STM32F103ZE有5个时钟源:HSI.HSE.LSI.LSE.PLL.   ①.HSI是快速内部时钟,RC振荡器,频率为8MHz,精度不高.   ②.HSE是快速外部时钟, ...

  9. Twenty Newsgroups Classification实例任务之TrainNaiveBayesJob(一)

    接着上篇blog,继续看log里面的信息如下: + echo 'Training Naive Bayes model' Training Naive Bayes model + ./bin/mahou ...

  10. Codeforces Round #350 (Div. 2)解题报告

    codeforces 670A. Holidays 题目链接: http://codeforces.com/contest/670/problem/A 题意: A. Holidays On the p ...