webforms和实体框架 [英] webforms and entity framework

查看:60
本文介绍了webforms和实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用下拉列表过滤datagridview。

While filtering the datagridview using dropdownlist.

我想首次显示网格中的所有记录,dropdwn列表将显示
全部共   最后。

I want to show all the records in grid first time and the dropdwn list will show All    intially.

但所有未显示在下拉列表中。

But All is not showing in the dropdown list.

代码附后。

谢谢。

Ganesh

 <asp:DropDownList ID="DropDownList1" runat="server" 
            AutoPostBack="True" DataSourceID="DeptEntityDataSource" 
            DataTextField="deptname" DataValueField="deptid" Height="25px" 
            Width="189px">
            <asp:listitem text="All" value="-1"> 
                </asp:listitem> 
        </asp:DropDownList>

推荐答案

设置AppendDataBoundItems =" true" 在< DropDownList1控件 。

set AppendDataBoundItems="true"  in DropDownList1 control .

我建议请对任何线程使用有意义的标题。此查询与实体框架没有任何关系。

I suggest please use a meaningful heading to any thread . This query do not have any relation with entity framework .


这篇关于webforms和实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆