BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
The EntRelId will show the initial value when the grid is displayed but will not show the drop data list with the data. The 2nd GridForeign column will show the drop down data but the field EntId matches the foreign key table. I did a simple foreach to display there is data in the foreignDatasource="@ents"
Video and code attached. Thanks for you help.
<GridForeignColumn Field="@nameof(EntRelsModel.EntRelId)" TValue="Ent" HeaderText="Related Name" ForeignDataSource="@ents" ForeignKeyField="EntId" ForeignKeyValue="FullName" Width="150px" Visible="relatedVisible"> </GridForeignColumn> <GridForeignColumn Field="@nameof(EntRelsModel.EntId)" TValue="Ent" HeaderText="Student Name" ForeignDataSource="@ents" ForeignKeyField="EntId" ForeignKeyValue="FullName" Width="150px" Visible="studentVisible"> </GridForeignColumn>
Hi Larry,
After reviewing your code, we have identified that the first foreign key column "Field" (EntRelId) is not present in the foreign key table, which is causing the reported issue.
To resolve this, we recommend ensuring that the "Field" is present in the foreign key table. So based on the field it will generate the Foreignkey Datasource.
Kindly check the below attached code snippet.
<GridForeignColumn Field="@nameof(EntRelsModel.EntRelId)" // This field is not present in foreignkey table TValue="Ent" HeaderText="Related Name" ForeignDataSource="@ents" ForeignKeyField="EntId" ForeignKeyValue="FullName" Width="150px" Visible="relatedVisible"> </GridForeignColumn> |
Please let us know if you have any concerns.
Regards,
Monisha
Hi, I understand the Foreign key is not required based on this response in another thread and I had it working like this with another GridForeignColumn definiton.
I figured out my problem. The drop down on a GridForeignColumn would not work if the same field defined in a Grid Column and GridForeignColumn as shown below. Once I removed the GridColumn definition the dropdown worked fine.
thanks for your response and overall support is amazing.
<GridColumn HeaderText="Related ID" IsPrimaryKey=true Field="@nameof(EntRelsModel.EntRelId)" Width="100px"></GridColumn>
<GridForeignColumn Field="@nameof(EntRelsModel.EntRelId)" TValue="Ent" HeaderText="Student Name" ForeignDataSource="ents" ForeignKeyField="EntId" ForeignKeyValue="FullName" Width="150px" Visible="@relatedVisible"> </GridForeignColumn>
Hi Larry,
Welcome. We are glad to hear that the reported issue has been resolved. Kindly get back to us if you have further queries. As always we will be happy to help you.