如题:小弟我的GridView有大概30列,想在某些列中加入分类筛选的功能(类似Excel),于是想在表头的某些列添加TextBox,某些列添加DropDownList。由于数据量大,所以数据源采用ObjectDataSourceHeaderTemplate我试验过,在加入DrowDownList之后,原来的表头文字就不见了,如果使用SqlDataSource,原有的排序功能也随之消失。我想问的是,能不能在保持原有表头文字(ObjectDataSource)或原有排序功能(SqlDataSource)的情况下,在HeaderTemplate中加入TextBox或者DropDownList。谢谢!
解决方案 »
- jquery 三个文件各有什么用处
- 前台js调用后台c#方法为什么每次都在第一次加载时执行
- 不用数据绑定控件绑定数据
- .net mvc https 求助 求关注
- 我这么设置的Cookie为什么说 未将对象引用设置到对象的实例。
- ASP.NET2.0中Login页面选择的问题
- 制作asp.net安装项目时要求对文件夹savefiles设置为aspnet用户完全控制
- 基类页面中如何获得继承它的页面的控件ID和变量?
- 外包项目遭受商业诈骗,大家帮忙想个办法啊.谢谢了
- 在GridLayout定位的页面,如何使页面布局居中?
- 急!FreeTextBox在线编辑器问题
- 请问datagrid能否达到以下要求?
{
DropDownList ddl = ( DropDownList)e.Row.FindControl("DropDownList1");
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl =sender as DropDownList;
}
答案应该给html代码吧……
<Columns>
<asp:TemplateField HeaderText="dropdownlistName">
<HeaderTemplate>
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
是要这种么?
<Columns>
<asp:TemplateField HeaderText="dropdownlistName">
<HeaderTemplate>
<asp:DropDownList ID="DropDownList2" runat="server">在这个后边打文字不就好了么?
</asp:DropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在加上另外的DropDownList,还能自动产生的排序功能,
这应该是做不到滴!
只能自己编写排序!