How to use recursion to build dynamic menu from database in c#
-
I'm trying to build a dynamic menu from database and pass it to DevExpress Menu control my table looks like: (Primary) (int) - nvarchar(50) - (int) Iserial - Department - ParentIserial if the department has no parent then ParentIserial = 0 otherwise it will = the parent's Iserial Ibuilt the model like this
public class TblDepartments {
\[Key\] \[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)\] public int Iserial { get; set; } public nvarchar(50) Department { get; set; } public int ParentIserial{ get; set; } public IEnumerable items { get; set; }
}
and I was following this link Overview - ASP.NET Core Menu Demo | DevExpress[^] so please tell me how to build the structure same as the have done it on their demo to pass it to the control Thanks in advance
JusT LeT YouR MinD WorK
-
I'm trying to build a dynamic menu from database and pass it to DevExpress Menu control my table looks like: (Primary) (int) - nvarchar(50) - (int) Iserial - Department - ParentIserial if the department has no parent then ParentIserial = 0 otherwise it will = the parent's Iserial Ibuilt the model like this
public class TblDepartments {
\[Key\] \[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)\] public int Iserial { get; set; } public nvarchar(50) Department { get; set; } public int ParentIserial{ get; set; } public IEnumerable items { get; set; }
}
and I was following this link Overview - ASP.NET Core Menu Demo | DevExpress[^] so please tell me how to build the structure same as the have done it on their demo to pass it to the control Thanks in advance
JusT LeT YouR MinD WorK
Why not ask the people who wrote the demo? You have a licence to use the controls, which gives you access to tech support from them - so use it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
-
Why not ask the people who wrote the demo? You have a licence to use the controls, which gives you access to tech support from them - so use it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
I don't only need the code I need to understand it
-
I don't only need the code I need to understand it
Again, why not ask them? They know their demo better than we will ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
-
Again, why not ask them? They know their demo better than we will ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
I already asked them but still no reply, However what I need is to understand how to populate sql server table to build the dynamic menu no matter to devexpress or even writing the html manually I hope you got my point
-
I'm trying to build a dynamic menu from database and pass it to DevExpress Menu control my table looks like: (Primary) (int) - nvarchar(50) - (int) Iserial - Department - ParentIserial if the department has no parent then ParentIserial = 0 otherwise it will = the parent's Iserial Ibuilt the model like this
public class TblDepartments {
\[Key\] \[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)\] public int Iserial { get; set; } public nvarchar(50) Department { get; set; } public int ParentIserial{ get; set; } public IEnumerable items { get; set; }
}
and I was following this link Overview - ASP.NET Core Menu Demo | DevExpress[^] so please tell me how to build the structure same as the have done it on their demo to pass it to the control Thanks in advance
JusT LeT YouR MinD WorK
Your class defines the table structure required (and vice versa) so ID - IdentityField ISerial - int - probably defines the sort order within the parents collection Department - self evident ParentISerial - I think thes is wrong as it should be the ParentID field Add the collection of children in the client.
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
-
Your class defines the table structure required (and vice versa) so ID - IdentityField ISerial - int - probably defines the sort order within the parents collection Department - self evident ParentISerial - I think thes is wrong as it should be the ParentID field Add the collection of children in the client.
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
Thanks for your reply can you please give more clarifications ?