tags:

views:

10

answers:

0

I have a gridview as given below

       <asp:GridView ID="gdNotes" runat="server" AutoGenerateColumns="false" 
              Width="913px"  DataKeyNames="NoteId">

            <Columns>

                <asp:TemplateField HeaderText="Select">
                <ItemTemplate>                    
                    <asp:LinkButton ID="lnkSelectRow" runat="server" Text="Select" 
                     OnClientClick='<%# Eval("NoteId", "ShowNote(\"{0}\"); return 
                     false;") %>'></asp:LinkButton>
                </ItemTemplate>
                </asp:TemplateField>    

              ... BoundField rows

                <asp:TemplateField HeaderText="Priority?" >
                   <ItemTemplate>                                                     
                       <asp:Image ID="Image1" ImageUrl="../Resources/checked.png"
                        runat="server"/>
                   </ItemTemplate>
                </asp:TemplateField>
                 </Columns>
        </asp:GridView>


    And the C# code inside the function: 

           foreach (DataRow dr in dt.Rows)
           {
            if (Convert.ToBoolean(dr["IsPriority"]) == true)
            {
                dr["Priority"] = "../Resources/unchecked.png";
            }
            else
            {
                dr["Priority"] = "../Resources/checked.png";                    
            }

        }

        gdNotes.DataSource = dt;
        gdNotes.DataBind();

Now this page is being loaded asynchronously using Ajax - XmlhttpObject from a javascript and the data is displayed in the parent page. If I have a aspx CheckBox field, I do not get an "object required" error, but when I add Enabled="False" or modify the entire control to an image control that shows the checked or unchecked image, I get the "Object required" error.

Has anyone done anything like this before? I need a way to enable/disable the checkbox in the grid, but since that wasnt possible I tried doing it with an image. but the image also throws an error.

Is it that the Xmlresponse needs it in a specific fashion that im missing?