AI OnAI Off
You should have tab Count and in that tab property Count. Did you tried creating few more properties ? With different tabs ?
Hi Dil500 k,
To create a custom tab, you can use the following code:
[GroupDefinitions]
public static class MyGroupNames
{
[Display(Order = 100)]
public const string Count = "Count";
}
You can place it anywhere you want in your solution. On application startup, episerver will create a new tab for you (if it doesn't exist).
To move the property to Count tab, you can use the following code:
[Display(GroupName = MyGroupNames.Count)]
public virtual int MyValue { get; set; }
To set a default value for MyValue property, you shouldn't use DefaultValue attribute. Instead, you have to override SetDefaultValues method in your page type:
public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);
MyValue = 3;
}
Your page type should look like this:
[ContentType(GUID = "DAF174A1-AB94-4BF1-A4A6-9191341A45B8")]
public class MyPage : PageData
{
[Display(GroupName = MyGroupNames.Count)]
public virtual int MyValue { get; set; }
public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);
MyValue = 3;
}
}
Hope this helps!
I created a site from episerver visual studio extension mvc empty site.I need to display property in group tab.So I have tried like this:
But it doesn't show as tab, It displayed under the Content Tab.Is this proper way to do this?