hey
i have found solution of my problem. . solution involve javascript so that page should not postback.
im posting it so that somebody else can benefit from it.
<script type="text/javascript">
function SelectAll(id)
{
var frm = document.forms[0];
for (i=0;i<frm.elements.length;i++)
{
if (frm.elements[i].type == "checkbox")
{
frm.elements[i].checked = document.getElementById(id).checked;
}
}
}
</script>
In the code behind
Protected Sub grdDeletedADs_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdDeletedADs.RowDataBound
Try
If (e.Row.RowType = DataControlRowType.Header) Then
DirectCast(e.Row.FindControl("chkAllRows"), CheckBox).Attributes.Add("onclick", "javascript:SelectAll('" & _
DirectCast(e.Row.FindControl("chkAllRows"), CheckBox).ClientID & "')")
End If
Catch ex As Exception
lblerror.Text=ex.Message
End Try
End Sub
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
Offline 88 posts
since Dec 2008