使用javascript更改gridview的属性 [英] using javascript to change the property of gridview
本文介绍了使用javascript更改gridview的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨所有
i希望在使用javascript函数点击按钮时将asp.net网站中的gridview控件的属性设置为false
i尝试了代码:
hi all
i want to set the property of gridview control in asp.net website AllowPaging to false when button clicked using javascript function
i tried the code:
document.getElementById('GridView7').setAttribute["AllowPaging"]= "False";
及其不工作:(
and its not working :(
推荐答案
[查看此链接]
i希望它能帮到你
[See this link]
i hope it helps you
你正在使用方法setAttribute NOT正确。
这是一个方法,而不是属性,所以试试:
You are using method setAttribute NOT properly.
This is a Method, not property, so try:
document.getElementById('GridView7').setAttribute("AllowPaging","False")
i want to print a gridview in a new page "print preview" without paging
so when the user clicks the print button
<input id="Button2" type="button" value="button" onclick="javascript:CallPrint('article');" />
callprint function called :
<script type="text/javascript">
function CallPrint(strid) {
// document.getElementById('GridView7').setAttribute["AllowPaging"]= "False";
// document.getElementById("GridView7").setAttribute("AllowPageing","False");
var prtContent = document.getElementById(strid);
var WinPrint = window.open('', '', 'letf=0,top=0,width=1000,height=500,toolbar=0,scrollbars=1,status=0,resizable=1,menubar=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
}
其中strid是包含gridview的div id
现在它只是在新窗口中显示带有分页属性的gridview的第一页
where " strid " is the div id containing the gridview
now its just show the first page of the gridview with paging property in a new window
这篇关于使用javascript更改gridview的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文