BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
From a programmatic structure I have a 'Room Class' with assigned ventilation sub class "RVS" Inside the nested "RVS" class I have a List
public class RoomModel
{
//Multiple other properties or sub-classes here.
public RVSModel RVS {get; set;}
}
public class RVSModel
{
public class myCodeClass
{
public string Code { get; set; }
public int ID { get; set; }
}
public ListMyCodes = new List ()
{
new myCodeClass(){Code = "ASHRAE 62.1 (2016)", ID = 1 },
new myCodeClass(){Code = "IMC CH. 4 (2018)", ID = 2 }
};
public string MyCode { get; set; }
}
My razor class is below, bound to 'Rooms'
<SfGrid DataSource="@Rooms" AllowGrouping="true" Height="800" Toolbar="ToolbarItems" EnableVirtualization="true">
<GridSelectionSettings Mode="Syncfusion.Blazor.Grids.SelectionMode.Both"></GridSelectionSettings>
<GridEditSettings AllowEditing="true" Mode="EditMode.Batch"></GridEditSettings>
<GridEvents CellSelected="CellSelectedHandler" TValue="Models.RoomModel"/>
<GridColumns>
<GridColumn Field=@nameof(Models.RoomModel.RoomNumber) HeaderText="Room Number" AllowGrouping="false" Width="100" AllowEditing="true" EditType="EditType.DefaultEdit"></GridColumn>
<GridColumn Field=@nameof(Models.RoomModel.RoomName) HeaderText="Room Name" AllowGrouping="false" Width="250" AllowEditing="true" ></GridColumn>
<GridColumn Field=@nameof(Models.RoomModel.guid) HeaderText="guid" AllowGrouping="true" Width="150" AllowEditing="true" Visible="false" IsPrimaryKey="true" ></GridColumn>
<GridColumn Field="RVS.MyCode" HeaderText="Code" AllowGrouping="false" Width="175" EditType="EditType.DropDownEdit" AllowEditing="true">
<EditTemplate>
<SfDropDownList ID="RVS.MyCode" TItem="RVS.myCodeClass" TValue ="string" @bind-Value"@((context as RoomModel).MyCode)" DataSource="RVS.MyCodes">
<DropDownListFieldSettings Value="Code" Text="Code"/>
</SfDropDownList>
</EditTemplate>
</GridColumn>
<GridColumn Field="RVS.Category" HeaderText="Category" AllowGrouping="false" Width="150" AllowEditing="true" ></GridColumn>
<GridColumn Field="RVS.Classification" HeaderText="Classification" AllowGrouping="false" Width="200" AllowEditing="true"></GridColumn>
</GridColumns>
</SfGrid>
Hi Joshua,
Greetings from Syncfusion support.
Based on your query, We have created the sample to bind country sub class list to the DropDown component. Kindly refer the attached sample for your reference and please get back to us if you need any further assistance.
Regards,
Sarveswaran PK
Good evening Sarveswaran,
I had reviewed that sample. Unfortunately the country sub class is not actually nested within the 'Order' class and therefore doesn't answer my question. I've tried some alterations to that example and that's where I am stuck.
I have altered altered the provided example to more follow the example that I am asking about. If this is not possible and I have to change my Code Architecture I understand. The idea here is that I will have multiple Order classes, all with different Country Options.
I appreciate your assistance!
Josh
Hi Joshua,
we will update the further details on or before 21st November 2022 . Until then we appreciate your patience.
Hi Joshua,
From your query, we checked your shared modified sample and found that your using
complex databinding in the project. We have already discussed this topic in our
UG documentation. Kindly refer the attached UG documentation link for your
reference.
Reference: https://blazor.syncfusion.com/documentation/dropdown-list/data-source#array-of-complex-data
https://blazor.syncfusion.com/documentation/datagrid/columns#complex-data-binding
Please get back to us, if you need any further assistance
Regards,
Sarveswaran PK
Hi Sarveswaran,
This helped perfectly, thank you so much!
Joshua,
We are glad that the issue has been resolved. Please get back to us for further assistance.
We are marking ticket as solved.
Regards.,
Suganya Gopinath.