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
495
How to edit in igHierarchicalGrid when the columns are bound/unbound to a property which is a class by itself and has other sub properties?
posted

Hi I am using igHierarchicalGrid (Ignite UI), which has a columns defined in the controller not in cshtml. I am using 2014.1, I am giving the sample design of the model. It has a property SignerAuth. Please see below:

var Signer1 = new SignerInformation()
            {
                SignerIndex = 0,
                SignerName = "Joe Dewo",
                SignatureStatus = true,
                eSign = SignerInformation.eSignature.InPerson,
                SignerAuth = new SignerAuthentication { 
AuthenticationMode = SignerAuthentication.AuthenticationType.Email,
EmailAddress = "test@immonline.com" ,
Details     = "Signer1 Details"}             };
 
            var Signer2 = new SignerInformation()
            {
                SignerIndex = 1,
                SignerName = "Rob",
                SignatureStatus = false,
                eSign = SignerInformation.eSignature.Remote,
                SignerAuth = new SignerAuthentication
                     {
                         AuthenticationMode = SignerAuthentication.AuthenticationType.KBA,
                         EmailAddress = "tes2t@immonline.com",
                         Details = "Signer2 Details"
                     }
            };
Controller:
authenMode.Group.Add(new GridColumn() { HeaderText = "Type",Key = "SignerAuth",DataType = "eSignature",Width = "15%",FormatterFunction = "lookupAuthiticationMode" });
        authenMode.Group.Add(new GridColumn() { HeaderText = "Email Address",Key = "SignerAuth",Template = "${SignerAuth.EmailAddress}",DataType = "string",Width = "15%" });
        authenMode.Group.Add(new GridColumn() { HeaderText = "Details",Key = "SignerAuth",Template = "${SignerAuth.Details}",DataType = "string",Width = "15%" });
        grid.Columns.Add(authenMode);
So for this column I set the UpdateSettings as below:
var Updating = new GridUpdating();
          
           Updating.EnableAddRow = false;
           Updating.EnableDeleteRow = false;
           //Set this mode for editing, cell,row, none and RowEditTemplate
           Updating.EditMode = GridEditMode.Cell;
           //apply it to child layouts
           Updating.Inherit = false;
           var colUpdateSettings = new List<ColumnUpdatingSetting>();
//Set settings for AuthenticationType
 
           ColumnUpdatingSetting columnUpdatingSettingForAuthenticationType = new ColumnUpdatingSetting();
           columnUpdatingSettingForAuthenticationType.ColumnKey = "SignerAuth";
           columnUpdatingSettingForAuthenticationType.EditorType = ColumnEditorType.Combo;
           JavaScriptSerializer serializer = new JavaScriptSerializer();
           columnUpdatingSettingForAuthenticationType.EditorOptions = String.Format("valueKey: 'id', textKey: 'Type', dataSource: {0}",
		serializer.Serialize(GetAuthenticationTypes()));
           colUpdateSettings.Add(columnUpdatingSettingForAuthenticationType);
I am able to manage the cell edit click, quit well, figure it out to populate the combo, I still have some issues with it but the main issue is 
it is applying the same settings to the EmailAddress and Details , I want EmailAddress and Details to be edited but should be text editor. because the Key is bound 
to SignerAuth, it is setting to combo to the other fields. I am attaching the code so that you have more clarity. I attached the screens also. 
Also, when I am setting the columnIndex, as below:
columnUpdatingSettingForAuthenticationType.ColumnIndex = 6;
 and set other properties, it is not working, what I observed in the generated code is columnIndex: -1 . What is the use of this column and where is the documentation for this in 2014.1?            
Any details example will be much appreciated.
PseudoCodeFiles.zip
Parents Reply Children
No Data