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
Nor Azlina Mahmud
NA
23
9.2k
Uncheck all checkbox still maintain check when data value 1
Apr 2 2013 10:41 PM
I have a select all checkbox at gridview header. I manage to do select all function but when uncheck all, it uncheck all checkbox including the data that has value 1. I want it to be when I uncheck all, the data that value 1 still check. how do I do that.. below the image is my sample code...
also how to make the checkbox text stays the same line as checkbox...
Tq so much..
<asp:TemplateField HeaderText="">
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAllGeneral" runat="server" Text="GENERAL"
Font-Size="Smaller" AutoPostBack="true"
OnCheckedChanged="chkSelectAllGeneral_CheckedChanged" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkgeneral" AutoPostBack="true" runat="server" />
</ItemTemplate>
</asp:TemplateField>
protected void chkSelectAllGeneral_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow rowItem in GridView3.Rows)
{
CheckBox chkgeneral = (CheckBox)(rowItem.Cells[0].FindControl("chkgeneral"));
chkgeneral.Checked = ((CheckBox)sender).Checked;
}
}
Reply
Answers (
1
)
EF : Get table to List with out using stored procedure.
BinaryReader loop ReadString