TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
krishna chaturvedi
NA
681
11.9k
How to hide and show gridview columns one by on using javasc
Jan 17 2013 12:00 AM
How to hide and show gridview columns one by on using javascript at client side only.
where idinow has current button id,
<script language="JavaScript">
function hideColumn(idinow) {
if (idinow == "GridView1_ctl01_Hide2") {
var calnumb = 1;
hidecal(calnumb)
}
else if (idinow == "GridView1_ctl01_Hide3") {
var calnumb = 2;
hidecal(calnumb)
}
else if (idinow == "GridView1_ctl01_Hide4") {
var calnumb = 3;
hidecal(calnumb)
}
else if (idinow == "GridView1_ctl01_Hide5") {
var calnumb = 4;
hidecal(calnumb)
}
return false;
}
function ShowColumn(idinow) {
if (idinow == "Show6") {
var calnumb = 1;
showcal(calnumb)
}
else if (idinow == "Show7") {
var calnumb = 2;
showcal(calnumb)
}
else if (idinow == "Show8") {
var calnumb = 3;
showcal(calnumb)
}
else if (idinow == "Show9") {
var calnumb = 4;
showcal(calnumb)
}
return false;
}
function showcal(calnumb) {
var col_num1 = calnumb;
var rows1 = document.getElementById("GridView1").rows;
for (i = 0; i < rows1.length; i++) {
rows1[i].cells[col_num1].disabled = false;
}
return false;
}
function hidecal(calnumb) {
var col_num = calnumb;
var rows = document.getElementById("GridView1").rows;
for (i = 0; i < rows.length; i++) {
rows1[i].cells[col_num1].disabled = true;
}
return false;
}
</script>
Reply
Answers (
0
)
adding query and transferring view to other view
audio/video file in asp.net