wpf combobox下拉列表 列表向上显示,有办法吗

温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(1823)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_080075',
blogTitle:'ComboBox下拉列表不正确显示 解决方法',
blogAbstract:'虽然我也是用了好一段VC的人了,可是今天才算是真正用过ComboBox. 我在使用过程中, 遇到了不能正确显示下拉列表内容的问题.&&&& CComboBox&& &m_//声明........................&&& DDX_Control(pDX, IDC_ROLE, m_role);//对话框的关联.............................m_role.AddString(_T(\"普通用户\"));//添加内容',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:8,
publishTime:2,
permalink:'blog/static/',
commentCount:5,
mainCommentCount:5,
recommendCount:1,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}可装载组合框 - ComboBox
继承自$.fn.combo.defaults,通过$.fn.combobox.defaults覆盖默认值
combobox显示的是一个可以编辑的文本框和一个下拉列表.允许用户从里面选择一个或者是多个值,用户可以直接输入值到列表顶部,或者可以从列表选择一个或多个现有值.
Dependencies
使用方法(Usage Example)
从&select&元素和一个预定义结构创建combobox.
&id="cc"&class="easyui-combobox"&name="dept"&style="width:200"&&
&&&&&value="aa"aitem1&&
&&&&bitem2&&
&&&&bitem3&&
&&&&ditem4&&
&&&&eitem5&&
&select id="cc" class="easyui-combobox" name="dept" style="width:200"&
&option value="aa"&aitem1&/option&
&option&bitem2&/option&
&option&bitem3&/option&
&option&ditem4&/option&
&option&eitem5&/option&
从&input&标记创建combobox.
&id="cc"&class="easyui-combobox"&name="dept"&&
&&&&data-options="valueField:'id',textField:'text',url:'get_data.php'"&&&
&input id="cc" class="easyui-combobox" name="dept"
data-options="valueField:'id',textField:'text',url:'get_data.php'" /&
使用javascript创建combobox
&id="cc"&name="dept"&value="aa"&&
&input id="cc" name="dept" value="aa"&
$('#cc').combobox({ &&
&&&&url:'combobox_data.json', &&
&&&&valueField:'id', &&
&&&&textField:'text'&&
$('#cc').combobox({
url:'combobox_data.json',
valueField:'id',
textField:'text'
创建两个依赖的combobox
&id="cc1"&class="easyui-combobox"&data-options=" &&
&&&&&&&&valueField:&'id', &&
&&&&&&&&textField:&'text', &&
&&&&&&&&url:&'get_data1.php', &&
&&&&&&&&onSelect:&function(rec){ &&
&&&&&&&&&&&&var&url&=&'get_data2.php?id='+rec. &&
&&&&&&&&&&&&$('#cc2').combobox('reload',&url); &&
&&&&&&&&}"&&&
&id="cc2"&class="easyui-combobox"&data-options="valueField:'id',textField:'text'"&&&
&input id="cc1" class="easyui-combobox" data-options="
valueField: 'id',
textField: 'text',
url: 'get_data1.php',
onSelect: function(rec){
var url = 'get_data2.php?id='+rec.
$('#cc2').combobox('reload', url);
&input id="cc2" class="easyui-combobox" data-options="valueField:'id',textField:'text'" /&
json数据转换示例:
&&&&"id":1, &&
&&&&"text":"text1"&&
&&&&"id":2, &&
&&&&"text":"text2"&&
&&&&"id":3, &&
&&&&"text":"text3", &&
&&&&"selected":true&&
&&&&"id":4, &&
&&&&"text":"text4"&&
&&&&"id":5, &&
&&&&"text":"text5"&&
"text":"text1"
"text":"text2"
"text":"text3",
"selected":true
"text":"text4"
"text":"text5"
Properties
这些属性继承至 combo,下面是combobox的一些新增属性.
NameTypeDescriptionDefault
valueField
绑定到这个combobox的基础数据值名.
绑定到这个combobox的数据字段名.
当文本改变时定义如何加载显示列表数据.如果设置为'remote' combobox从远程服务器加载数据.当设置为'remote'模式时,
用户输入的信息将发送作为http请求参数,参数名为'q'到服务器检索新的数据.
一个从远程服务器加载列表数据的URL.
检索数据的http请求方法.
需要加载到列表的数据.
&input class="easyui-combobox" data-options="
valueField: 'label',
textField: 'value',
label: 'java',
value: 'Java'
label: 'perl',
value: 'Perl'
label: 'ruby',
value: 'Ruby'
定义如何过滤本地数据,当'mode'设置为'local'的时候. 这个函数提供两个参数:q: 用户输入的文本.row:
列表的行数据.返回true 允许行显示 .
$('#cc').combobox({
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) == 0;
定义如何呈现行. 这个函数提供一个参数 :row.
$('#cc').combobox({
formatter: function(row){
var opts = $(this).combobox('options');
return row[opts.textField];
function(param,success,error)
定义如何从远程服务器加载数据. 返回false终止这个动作.这个函数提供一下参数:param:传递给远程服务器的参数对象.success(data):
当检索数据成功这个回调函数将被调用.error():当检索数据失败(异常,而不是返回空数据的时候)这个函数将被调用.
json loader
事件继承至 combo, 以下是combobox的新增事件.
NameParametersDescription
onBeforeLoad
一个请求在加载数据之前触发,返回false取消这个加载动作.
// 在从远程服务器加载数据之前改变请求参数
$('#cc').combobox({
onBeforeLoad: function(param){
param.id = 2;
param.language = 'js';
onLoadSuccess
当远程数据加载成功之后触发.
onLoadError
远程数据加载出错触发.
当用户选择一个列表项的时候触发.
onUnselect
当用户取消选择一个列表项的时候触发.
方法继承至 combo,以下是combobox的新增的或者是重写的方法.
NameParameterDescription
返回 options 对象.
返回加载数据.
返回本地列表数据.
请求远程服务器列表数据.传入'url'参数重写原始的URL值.
$('#cc').combobox('reload');
//使用原始URL重新加载列表数据
$('#cc').combobox('reload','get_data.php');
//使用新的URL重新加载列表数据
设置 combobox 值数组.
$('#cc').combobox('setValues', ['001','002']);
设置 combobox 值.
$('#cc').combobox('setValues', '001');
清除 combobox 值.
选择特定的项.
取消特定的选择项.    
$('#Id').combogrid('grid').datagrid('selectRecord',value值);&用来设置默认选中
$('#goodsSelect').combogrid('grid').datagrid("clearSelections");清除选择
阅读(...) 评论()相关文章推荐:
COMBOBOX显示行数
VC中, 应该如何使combobox的下拉列表显示出来?
阅读(7856) 回复(2)
其他文章推荐
&DataRowView dr = cmbRightType.Items[cmbRightType.SelectedIndex] as DataRowV&&&&&&&&&&& _selectValue = dr["TableName"].ToString();& //获取combx的值
阅读(450) 回复(0)
[code]#!/usr/bin/env ruby
require 'gtk2'
def add_product(treeview, list)
# Create a dialog that will be used to create a new product.
dialog = Gtk::Dialog.new(
"Add a Product",
Gtk::Dialog::MODAL,
[ Gtk::Stock::ADD,
Gtk::Dialog::RESPONSE_OK ],
[ Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL ]
# Create widgets that will be packed into the dialog....
阅读(1395) 回复(1)
我有2个combobox,其中data是combobox0中的数据,我想当combobox0中选择浙江的时候在combobox1中加入杭州,但问题出来了,我要是在combobox0选择了2次浙江,在combobox1就会重复出现杭州的问题,怎么解决啊,源代码如下,我的if self.combobox.GetString(self.combobox.GetSelection())
"杭州".decode('utf-8'):判断居然不行,而且哪怕行的话,有这么多市,一个个判断也很累,有什么办法解决啊
if data == "浙江".decode('utf-8'):
阅读(2266) 回复(1)
Overview = """\
A combobox is like a combination of an edit control and a listbox. It can be
displayed as static list with editable or read- or a drop-down
or a drop-down list without a text field.
Normally, combobox have be created for read-only controls. Meanwhile it can be
dynamically created (that is, it is initially empty but then we 'grow' it out of...
阅读(1079) 回复(0)
一般的JTextField只要setDocument(new PlianDocument(){....})就行,
为什么以下这样不行?
好像没起作用
combobox _combobox1 = new combobox();
Component component1 = _combobox1.getEditor().getEditorComponent();
if(component1 instanceof JTextField ) {
((JTextField )component1).setDocument(new LengthLimitedDocument ());
LengthLimitedDocument 是这样定义的:
class LengthL...
阅读(1813) 回复(1)
当combobox下拉时不管有多少个项目都不会出现滚动条,如何当项目大于10个的时候就出示滚动条来拖动。。。谢谢
阅读(3136) 回复(3)
perl Tk中没有象VB中的combobox控件, 我感觉是不是应该用ListBox和Text或Entry结合来实现。 请高手指点。多谢!
阅读(1516) 回复(0)
新学winsdk编程,不知道怎么给combobox添加item,知道的大侠帮个忙,谢谢!
hWndCom = CreateWindowEx(WS_EX_STATICEDGE,"combobox","combox",WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_SIMPLE,10,140,100,20,hWnd,NULL,hinstance,NULL);
这个是创建窗口,然后怎么做就不知道了。
阅读(924) 回复(0)
get a different model of serial number for combobox.
private DefaultcomboboxModel getcomboboxModel(int start, int finish, int step, int adjust) {
String combo[] = new String[(finish-start+1)/step];
for(int i = i
combo[(i-start)/step] = java.lang.String.valueOf(i + adjust);
DefaultcomboboxModel comboModel = new DefaultcomboboxModel(combo);
阅读(977) 回复(0)
[code]Class的定义
public class comboboxItem
private string _text=
private object _value=
public string Text
get{return this._}
set{this._text=}
public object Value
get {return this._}
set{this._value=}
public override string ToString()
return this._
comboboxItem newItem = new comboboxItem();
阅读(1369) 回复(2)
盛拓传媒:
北京皓辰网域网络信息技术有限公司. 版权所有
北京市公安局海淀分局网监中心备案编号:
广播电视节目制作经营许可证:编号(京)字第1149号
ITPUB推荐文章解答你所有技术难题2012年7月 Delphi大版内专家分月排行榜第二
2013年8月 Delphi大版内专家分月排行榜第三2012年8月 Delphi大版内专家分月排行榜第三2012年6月 Delphi大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。

我要回帖

更多关于 combobox设置下拉列表 的文章

 

随机推荐