This is a migrated thread and some comments may be shown as answers.

[Solved] Foreign Key Column shows Id in Edit and Create Mode

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Malin
Top achievements
Rank 2
Malin asked on 29 Aug 2012, 05:52 AM
In my view I have the following coding.
columns.ForeignKey(o => o.BuyerID, (IEnumerable)ViewData["buyers"],
                   "Id", "Name").Title("Buyer");
Model it is as,
public int BuyerID
        {
            get;
            set;
        }

The foreign key works fine in the view. But, when I use the edit and insert mode, It shows the Id instead of name. What is wrong here?

1 Answer, 1 is accepted

Sort by
0
Malin
Top achievements
Rank 2
answered on 29 Aug 2012, 11:09 AM
Hi All,

I have missed the Template folder. Now its working fine. 
Tags
Grid
Asked by
Malin
Top achievements
Rank 2
Answers by
Malin
Top achievements
Rank 2
Share this question
or