Adding one record in a grid

  1. #1

    Adding one record in a grid

    Hi everybody,


    how can i insert a value in a column, which will be readonly or hidden when i insert a new record.


    My goal is the following:

    public class S
    {
     int pkInt;
     string someData;
     DateTime moreData;
    
    ...
    
    
    }
    
    
    public class B
    {
     Guid pk;
     string myData;
     int fkClassA;
    }


    My grid have an associated store which is bound to the class B. This store is rendered in a form which have a store bounded to class A.

    New items added to the grid, will be mandatory that the field fkClassA must be equal to the primary of the form data.

    How can i prevent the user from changing this data???


    Thanks,
    Nuno Santos

  2. #2

    RE: Adding one record in a grid

    *Hi,

    I think there is more then 1 way to skin a cat here. *Is this value always readonly? *If so, you would be adding an editor to each field, so just make the editor readonly or don't add an editor at all and the value will be readonly. *Keep this in mind what a column is ... its the view into a data store.


    ie. *


    // can be changed
    <ext:Column ColumnID="Fri" DataIndex="Fri" *Header="Fri" Width="44">
    ** * * * * * * * * * <Editor>
    ** * * * * * * * * * * *<ext:TextField ID="FriText" *runat="server"/>
    ** * * * * * * * * *</Editor>
    ** * * * * * * *</ext:Column>
    
    
    // cant be changed
    <ext:Column ColumnID="Fri" DataIndex="Fri" *Header="Fri" Width="44">
    ** * * * * * * * * * <Editor>
    ** * * * * * * * * * * *<ext:TextField ID="FriText" *runat="server" readonly="true"/>
    ** * * * * * * * * *</Editor>
    ** * * * * * * *</ext:Column>
    
    
    // also cannot be changed
    <ext:Column ColumnID="Fri" DataIndex="Fri" *Header="Fri" Width="44">
    ** * * * * * * *</ext:Column>

Similar Threads

  1. [CLOSED] Adding a new grid record
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 06, 2012, 3:14 PM
  2. [CLOSED] Adding New Record at run time
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 27, 2012, 12:17 PM
  3. How to set Grid record dirty?
    By speddi in forum 1.x Help
    Replies: 0
    Last Post: Jul 16, 2010, 8:47 PM
  4. [CLOSED] [1.0] Store adding record
    By state in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Dec 11, 2009, 6:24 PM
  5. [CLOSED] Adding a new Store Record - Not a Record object
    By Steve in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 15, 2009, 7:40 AM

Posting Permissions