Update GridView with Inverse Boolean value
<p>I am using dropdown feature of VS 2010 to create GridView and simple functions like Edit, Update, Delete etc. My database table has 3 columns: URL (nvarchar(50)) , Private (bit), Links (int). My GridView shows following data: URL, <b> Public (inverse of Private value in Database) </b>, Links</p>

<p>This is how I am showing the inverse value on my aspx page</p>

<pre><code>&lt;Columns&gt;
        &lt;asp:BoundField DataField="URL" HeaderText="URL" ReadOnly="True" 
            SortExpression="URL" /&gt;
        &lt;asp:TemplateField HeaderText="Private" SortExpression="Private"&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:CheckBox ID="CheckBox1" runat="server" Checked='&lt;%# Bind("Private") %&gt;' /&gt;
            &lt;/EditItemTemplate&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:CheckBox ID="CheckBox1" runat="server" 
                    Checked='&lt;%# Inverse(Eval("Private")) %&gt;' Enabled="False" /&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:BoundField DataField="links" HeaderText="links" SortExpression="links" /&gt;
        &lt;asp:CommandField ShowEditButton="True" /&gt;
    &lt;/Columns&gt;
</code></pre>

<p>Problem: The value shown in checkbox of GridView is inverse of the value stored in database. When I click on <b>Edit</b> corresponding to a row in DataGrid, it shows me the value from the database because I am binding it as Bind("Private") in . This is opposite to what I want to show to user. Once I press click Update or Cancel, it shows me the inverse value of what is stored in the Private column of the database. </p>

<p>If I use Inverse(Eval("Private") in  it shows the correct value but when I try to update it throws the below exception:</p>

<pre><code>Cannot insert the value NULL into column 'Private', table 'DatabasePath\DATABASE1.MDF.dbo.Data'; column does not allow nulls. UPDATE fails.The statement has been terminated.
</code></pre>

<p>Please let me know how I can show consistent value in the checkbox all times? Many thanks!</p>
