Hi I have the following gridview which contains a CheckBoxField. Now when delete is clicked I want to do an if statement to see if the checkbox is checked and if so cancel the delete and display an error message.

Not quite sure how to do this.

Gridview code:
Code:
<asp:GridView ID="SharedGridView" runat="server" AutoGenerateColumns="False" DataSourceID="SqlManageSharedArea" CellPadding="4" ForeColor="#333333" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" datakeynames="doc_area_id" onrowdeleted="SharedGridView_RowDeleted" onrowdeleting="SharedGridView_RowDeleting" AllowPaging="True" AllowSorting="True" PageSize="5" style="position: static">
            
            <Columns>
                <asp:BoundField DataField="doc_area_name" HeaderText="Name" SortExpression="doc_area_name" />
                <asp:templatefield headertext="Type">
	                <itemtemplate>
		                <%# GetAreaTypeSharedString(Eval("doc_area_type")) %>
	                </itemtemplate>
                </asp:templatefield> 
                <asp:CheckBoxField DataField="doc_area_default" HeaderText="Default" SortExpression="doc_area_default" />
                <asp:HyperLinkField Text="<img src='../images/edit.gif' border='0' />" DataNavigateUrlFormatString="EditSharedDocumentArea.aspx?doc_area_id={0}" DataNavigateUrlFields="doc_area_id" />
                <asp:CommandField ButtonType="Image" DeleteImageUrl="~/Images/Delete.gif" DeleteText="Delete Area" ShowDeleteButton="True">
                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                </asp:CommandField>
            </Columns>
</asp:GridView>
If statement in code behind:
Code:
protected void SharedGridView_RowDeleting(Object sender, GridViewDeleteEventArgs e)
    {
        if (SharedGridView ??????????
        {
            e.Cancel = true;
            MsgShared.Text = "The area has not been deleted. You may not delete the Shared Area Default.";
        }
    }
Thanks for any help you can give!