如何制作Gridview标题可编辑模式? [英] How Do I Make Gridview Header Editable Mode?

查看:92
本文介绍了如何制作Gridview标题可编辑模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作gridview标题可编辑模式?在这里,我必须在可编辑模式下编辑标题,并且不希望在gridview内部使用文本框来获取更新网格标题。

How do i make gridview header editable mode? here i have to edit header in editable mode and don't want to take textbox inside gridview for update grid header.

推荐答案

您必须继承自定义控件来自ListView。添加编辑模式(标题)属性作为 bool 。如果已启用,则在顶部添加透明文本框或透明内容。当文本改变时,标题将改变其文本,并且该框将隐藏。

-iProgramIt
You would have to make a custom control inherited from the ListView. Add a property that is "Edit Mode (For Headers)" as a bool. If it is on, then add a textbox or something transparent over the top. When the text is changed, the header will change its text, and the box will hide.
-iProgramIt


同意解决方案#1。

除此之外,您可以从后面的代码设置标题文本,如下所示:

myGridView.HeaderRow.Cells [index] .Text =New标题文字;



-KR
Agree with Solution #1.
Apart from that you can set the header text from code behind like this:
myGridView.HeaderRow.Cells[index].Text = "New Header Text";

-KR


这篇关于如何制作Gridview标题可编辑模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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