I have a class which is populated like this
var Signer2 = new SignerInformation() { SignerIndex = 2, SignerName = "Rob", SignatureStatus = false, eSign = SignerInformation.eSignature.Remote, SignerAuth = new SignerAuthentication { AuthenticationMode = SignerAuthentication.AuthenticationType.Password ,EmailAddress = "tes2t@immonline.com" ,Details = "Signer2 Details" } }; var SignersInfoCol = new List<SignerInformation>(); SignersInfoCol.Add(Signer2); return SignersInfoCol.AsQueryable();
My Hierarchical grid columns are defined like this below:
grid.AutoGenerateLayouts = false; grid.AutoGenerateColumns = false; grid.PrimaryKey = "SignerIndex"; grid.Width = "100%"; grid.Columns.Add(new GridColumn() { HeaderText = "Signer Index",Key = "SignerIndex",DataType = "number",Width = "10%", Hidden=true}); grid.Columns.Add(new GridColumn() { HeaderText = "Signer Name",Key = "SignerName",DataType = "string",Width = "10%" }); grid.Columns.Add(new GridColumn() { HeaderText = "Status",Key = "SignatureStatus",DataType = "string",Width = "10%" }); grid.Columns.Add(new GridColumn() { HeaderText = "Signer Information",Key = "eSign",DataType = "string",Width = "10%" }); grid.Columns.Add(new GridColumn() { HeaderText = "Authentication Mode",Key = "SignerAuth.AuthenticationMode",DataType = "string",Width = "10%" }); grid.Columns.Add(new GridColumn() { HeaderText = "EmailAddress",Key = "SignerAuth.EmailAddress",DataType = "string",Width = "10%" }); grid.Columns.Add(new GridColumn() { HeaderText = "Details",Key = "SignerAuth.Details",DataType = "string",Width = "20%" });
1) So How can I set the complex property?
2) How to format the Status to radio button in control code? and set its status?
You help is much appreciated.
Hello,
You can define the columns in your view as described in the documentation I have provided.
However, your approach is fine, too.
Hi Nikolay,
Please see my comments below:
I have a class
var Signer2 = new SignerInformation() {
SignerIndex = 2,
SignerName = "Rob",
SignatureStatus = false,
eSign = SignerInformation.eSignature.Remote,
SignerAuth = new SignerAuthentication {
AuthenticationMode = SignerAuthentication.AuthenticationType.KBA,
EmailAddress = "tes2t@immonline.com",
Details = "Signer2 Details" }
};
In the Hierarchical Grid I used it like this, ofcourse I had to group the below 3 columns, hence you see Group collection.
authenMode.Group.Add(new GridColumn() { HeaderText = "Type",Key = "SignerAuth",DataType = "string",Width = "15%",FormatterFunction = GetAuthiticationMode() }); 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);
private static string GetAuthiticationMode() { var sb = new StringBuilder(); sb.Append(" function(obj){"); sb.Append(" if (obj.AuthenticationMode == 0 ){return 'Email';}"); sb.Append(" else if (obj.AuthenticationMode == 1 ){ return 'Password';} "); sb.Append(" else if (obj.AuthenticationMode == 2 ){ return 'KBA';} "); sb.Append("} "); return sb.ToString();}All this is done in the controller code.Let me know if there is any other good way to do. I will be waiting for your reply.
I'm following up to see if you have any other questions or concerns.
For each sub-property you have to define a columnLayout in your igHierarchicalGrid and set the relationship between them: http://help.infragistics.com/Help/Doc/jQuery/2014.1/CLR4.0/html/igHierarchicalGrid_Columns_and_Layouts.html#layouts
Let me know if you have any further questions.
No issues, I figured it out by referring the documentation and other examples and used Template and FormatterFunction technique and moved forward.
I was referring to a class which has a property and that property will have some more sub properties. Hope you understood now. Do let me know if there is any other way.