无论如何我可以使用任何较轻的控件替换gridview内的下拉列表吗?

编程入门 行业动态 更新时间:2024-10-12 14:20:03
本文介绍了无论如何我可以使用任何较轻的控件替换gridview内的下拉列表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我需要一些帮助。我有一个gridview,contanis 5模板字段2个复选框,2个文本框和一个下拉列表。 我在Gridview的RowCommand事件中为这些控件赋值。但问题是网格需要将近5分钟才能加载和渲染(记录大约2000)。所以我将所有asp模板字段控件(Textbox和Checkbox)替换为html输入类型,现在网格加载时间较短(没有下拉列表测试)。 但是当我添加下拉列表,加载需要更多时间。有什么方法可以替换gridview中的这个下拉列表以使网格更快。 P.S.我不应该使用分页。 感谢您告诉我可能性。

解决方案

您好, 如果你没有在Gridview中使用Paging,那么为什么你不使用简单的HTML表而不是Gridview。 使用HTML表并设置属性ID和Runat =Server并动态填充它。您可以在此HTML表运行时内使用任何服务器控件。 它可能会减少加载时间....

我假设当您输入每个字符串时,列表框闪烁并重新绘制 您应该将WM_SETREDRAW消息发送到列表框,设置为FALSE以停止重绘和然后当它加载另一个WM_SETREDRAW为TRUE msdn.microsoft/en-us/library/windows/desktop/dd145219%28v=vs.85%29.aspx [ ^ ] 尝试一下,看看重绘闪烁的速度有多大。 实际上如果你有那么多字符串我会做一个所有者绘制列表框并简单地传入一个指向所有字符串数据的指针当你清楚地将所有字符串已经存在于内存块或结构中时,使windows恢复所有字符串并使用更多内存似乎相当愚蠢。 因此,重绘将是几乎是即时的,因为它只需要将可见的字符串绘制到屏幕并退出。 有很多关于所有者绘制列表框的文章尝试搜索没有字符串的所有者绘制的列表框

Hi Everyone, I need a bit of help. I have a gridview which contanis 5 template fields 2 checkboxes, 2 textboxes and a dropdownlist. I assigned value to those controls in RowCommand event of the Gridview. But the problem is grid takes nearly 5 minutes to load and render (record arounds 2000). So I replaced all asp template field controls (Textbox & Checkbox) to html imput types and now grid takes less time to load (tested without dropdownlist). But when I add dropdownlist, it takes more time to load. Is there any way I could replace this dropdown inside the gridview to make the grid faster. P.S. I should not use paging. Thanks for letting me know the possibilities.

解决方案

Hello, If you are not using Paging in Gridview then instead of Gridview why you are not using simple HTML table. Use HTML Table and set attributes ID and Runat="Server" and fill it dynamically. You can use any server control inside this HTML table runtime. It may reduce loading time....

I assume the listbox is flashing and redrawing as you enter each and every string You are supposed to send a WM_SETREDRAW message to the listbox with a setting of FALSE to stop it redrawing and then when it is loaded another WM_SETREDRAW to TRUE msdn.microsoft/en-us/library/windows/desktop/dd145219%28v=vs.85%29.aspx[^] Try that and see how much of the slow down is from the redraw flashing. In reality if you have that many strings I would do an owner draw listbox and simply pass in a pointer to all the string data it seems rather silly to make windows restore all the strings and use more memory when you clearly have all the strings already in a memory block or structure. The redraw would therefore be almost instant as it simply has to draw the visible strings to screen and exit. There are plenty of articles on owner draw listboxes try searching "Owner Drawn listbox without strings"

更多推荐

无论如何我可以使用任何较轻的控件替换gridview内的下拉列表吗?

本文发布于:2023-10-08 14:56:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472958.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   控件   较轻   无论如何   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!