Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
how to set up Readonly Column in xamGrid?
posted

How to set up Readonly Column in xamGrid, for example, for system generated ID column?

Parents
  • 21382
    Verified Answer
    posted

    If you access the column by it's Key you can get the ColumnBase object, cast it to the EditableColumn and set it's IsReadOnly flag

     

     

    sorta like this

    EditableColumn ec = grid.Columns["myKey"] as EditableColumn;

    if (ec!=null)

    ec.IsReadOnly = true;

     

     

    Or if you declare your columns in Xaml, columns that support that property (like TextColumn, CheckBoxColumn) can just set the property there.

     

     

     

     

     

     

    <ig:XamGrid.Columns

    >

     

     

     

     

    <ig:TextColumn Key="myKey" IsReadOnly="true"></ig:TextColumn

    >

     

     

     

     

    </ig:XamGrid.Columns

    >

Reply Children