Visible vs Display on Grid Column Definition

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    25 posts
    Member since:
    Aug 2008

    Posted 29 Oct 2009 Link to this post

    Hello; I have two questions.

    What is the difference between the Visible property and the Display property on a RadGrid's Column definition?

    For example:

    <rad:RadGrid ID="gdCompanies" runat="server"
      <MasterTableView AutoGenerateColumns="false" EditMode="EditForms"
        <Columns> 
        <rad:GridBoundColumn DataField="CompanyId" UniqueName="CompanyId" 
          Visible="false" 
          Display="false"/> 
        </Columns> 
      </MasterTableView> 
    </rad:RadGrid> 
     

    Also, is there a way to disable a field (specifically a GridBoundColumn) from being displayed in edit mode? I have tried visible=false and display=false, but the field is still displayed in edit mode (EditForms flavor).

    Thanks,

    Matthew

  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 29 Oct 2009 Link to this post

    The visible property is used through server-side to determine whether or not an item should be rendered to the page, while display simply changes the CSS style to 'display:none';. Basically if you are just trying to dynamically show/hide columns the Display property is the way to go.

    As for disabling a column in the edit-form, try setting the column's ReadOnly property to true (false by default).

Back to Top