Results 1 to 2 of 2

Thread: Gridview column readonly

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    Gridview column readonly

    I used the Configure Data source wizard to bound my Grid. Now I want to make one column readonly when the Edit link is clicked. Not sure where I would set?

    Code:
    asp:GridView ID="gv" runat="server" DataSourceID="SqlDataSource1" 
            
            style="top: 630px; left: 21px; position: absolute; height: 133px; width: 861px" 
            AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" 
            Font-Bold="False">
        
        
       
       </asp:gridview>
            
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
            
            SelectCommand="SELECT &quot;SURPLUS_YR&quot;, &quot;DIV&quot;, &quot;SEQ_NO&quot;, &quot;SURPLUS_TYPE&quot;, &quot;DECAL_NO&quot;, &quot;FIELD_DESC&quot;, &quot;FIELD_MFGR&quot;, &quot;FIELD_SERIAL_NO&quot;, &quot;ITEM_CONDITION&quot;, &quot;SURPLUS_REASON&quot; FROM &quot;SPAR_DECAL_ITEM&quot; WHERE ((&quot;SURPLUS_YR&quot; = :SURPLUS_YR) AND (&quot;SEQ_NO&quot; = :SEQ_NO) AND (&quot;DIV&quot; = :DIV))" 
            DeleteCommand="DELETE FROM &quot;SPAR_DECAL_ITEM&quot; WHERE &quot;SURPLUS_YR&quot; = :SURPLUS_YR AND &quot;DIV&quot; = :DIV AND &quot;SEQ_NO&quot; = :SEQ_NO AND &quot;SURPLUS_TYPE&quot; = :SURPLUS_TYPE AND &quot;DECAL_NO&quot; = :DECAL_NO" 
            InsertCommand="INSERT INTO &quot;SPAR_DECAL_ITEM&quot; (&quot;SURPLUS_YR&quot;, &quot;DIV&quot;, &quot;SEQ_NO&quot;, &quot;SURPLUS_TYPE&quot;, &quot;DECAL_NO&quot;, &quot;FIELD_DESC&quot;, &quot;FIELD_MFGR&quot;, &quot;FIELD_SERIAL_NO&quot;, &quot;ITEM_CONDITION&quot;, &quot;SURPLUS_REASON&quot;) VALUES (:SURPLUS_YR, :DIV, :SEQ_NO, :SURPLUS_TYPE, :DECAL_NO, :FIELD_DESC, :FIELD_MFGR, :FIELD_SERIAL_NO, :ITEM_CONDITION, :SURPLUS_REASON)" 
            UpdateCommand="UPDATE &quot;SPAR_DECAL_ITEM&quot; SET &quot;FIELD_DESC&quot; = :FIELD_DESC, &quot;FIELD_MFGR&quot; = :FIELD_MFGR, &quot;FIELD_SERIAL_NO&quot; = :FIELD_SERIAL_NO, &quot;ITEM_CONDITION&quot; = :ITEM_CONDITION, &quot;SURPLUS_REASON&quot; = :SURPLUS_REASON WHERE &quot;SURPLUS_YR&quot; = :SURPLUS_YR AND &quot;DIV&quot; = :DIV AND &quot;SEQ_NO&quot; = :SEQ_NO AND &quot;SURPLUS_TYPE&quot; = :SURPLUS_TYPE AND &quot;DECAL_NO&quot; = :DECAL_NO">
            
            <SelectParameters>
                <asp:ControlParameter ControlID="txtYr" Name="SURPLUS_YR" PropertyName="Text" 
                    Type="String"  />
                <asp:ControlParameter ControlID="txtSeqNo" Name="SEQ_NO" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="txtDiv" Name="DIV" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="SURPLUS_YR" Type="String" />
                <asp:Parameter Name="DIV" Type="String" />
                <asp:Parameter Name="SEQ_NO" Type="String" />
                <asp:Parameter Name="SURPLUS_TYPE" Type="String" />
                <asp:Parameter Name="DECAL_NO" Type="Decimal" />
            </DeleteParameters>
            <UpdateParameters>
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Gridview column readonly

    Hey,

    I would recommend that you take a look at this thread:

    http://www.vbforums.com/showthread.php?t=587683

    This topic was covered there.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width