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

Foreign Key Drop Down Disappears

12 Answers 228 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.
Evan
Top achievements
Rank 1
Evan asked on 31 Oct 2012, 02:38 PM
I spent two days battling an issue where a drop down in the grid would disappear after selecting a value and clicking out of the cell.(similar to the foreign key demo/example)

I finally figured out that switching to the parameterless .Grid<T>() call fixed the issue.  I was migrating some Telerik MVC code, so I was calling the other overload.
@Html.Kendo().Grid(@Model.TradeEntryDetails) -> @Html.Kendo().Grid<TradeEntryDetailModel>()

I don't see any reason that one should work and the other not, so hopefully Telerik can fix this.  I sure wasted a lot of time on it.

12 Answers, 1 is accepted

Sort by
0
Evan
Top achievements
Rank 1
answered on 31 Oct 2012, 02:47 PM
I think I spoke too soon.  I'm still having the issue.  Any suggestions?  I have the example one up and running on my local just fine, but the one I modeled after it will not show selected values for new rows.(it does work for existing rows)
0
Evan
Top achievements
Rank 1
answered on 31 Oct 2012, 02:53 PM
Wow, it was a nullable int!  Changed my model from int? to int and it magically worked.
0
Phil
Top achievements
Rank 1
answered on 25 Mar 2015, 04:29 PM
So over 2 years later, I just ran into this very bug myself. Over 2 years without it being fixed - isn't it about time, Telerik?
0
Vladimir Iliev
Telerik team
answered on 26 Mar 2015, 06:32 AM
Hi Phil,

The issue described in this forum post is already fixed before 3 years and it's not related to your scenario with hierarchical Grid. Also please keep in mind that it is highly recommended that you keep related questions in one support thread or a forum post, so that we can easily keep track of your support history and provide better answers in a shorter time.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Phil
Top achievements
Rank 1
answered on 26 Mar 2015, 12:03 PM
Well, to post something helpful on the issue, this was Vladimir's reply elsewhere on the highly obscure solution, which entails modifying the editor template associated with the ForeignKeyColumn - something which is not documented in association with the usage of ForeignKeyColumn:

------

Please note that when editing nullable field using the ForeignKeyColumn you should set the "ValuePrimitive" option of the editor in order to always set the value:

@model object
@(Html.Kendo().DropDownListFor(m => m).ValuePrimitive(true)     .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"]))

This behavior is already described in the dropDownList client-side API:  valuePrimitive option
0
Evan
Top achievements
Rank 1
answered on 31 Mar 2015, 04:53 AM
Wow, that seems to work.  Thanks Phil.  Vladimir, how exactly was this fixed 3 years ago?  Also, Phil's post seemed plenty relevant to me, whereas your post, aside from being rude, was not helpful or relevant at all.
0
Evan
Top achievements
Rank 1
answered on 31 Mar 2015, 05:23 AM
Actually, it doesn't really fix everything.  If you add a new row and select the first item *poof* it's gone when you change cells.
0
Vladimir Iliev
Telerik team
answered on 31 Mar 2015, 06:08 AM
Hello Evan,

As this thread is out of the original topic, may I kindly ask you to open a new support thread / forum post for the Grid? In this way it is much easier to follow and concentrate on the particular issue which usually leads to its faster resolving.

Thank you in advance for the understanding.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Evan
Top achievements
Rank 1
answered on 31 Mar 2015, 01:57 PM
How are we off topic?  My original question was clearly specific to the grid. What is the resolution?  You said it is fixed, but I still have no idea how to fix it...
0
Vladimir Iliev
Telerik team
answered on 01 Apr 2015, 10:30 AM
Hi Evan,

Apologize if I was not clear enough - current thread is out of the original topic as the described behavior is not related to the original issue where the editor is actually disappearing, where currently the selected value is not persisted in the Grid underlying model. That why I would ask you once again to open a new support thread / forum post and provide detailed information about your current setup - this way we will be able to advice you better how to proceed.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Evan
Top achievements
Rank 1
answered on 10 Apr 2015, 12:31 PM

Maybe I wasn't clear enough in my post but the issue has always been that the value doesn't appear after editing, not that the actual dropdown does something wrong.  The dropdown should disappear after selecting the value and clicking out of the cell.  Similar to the mentioned demo, the grid is in Bulk, Ajax editable mode.

 I'm sure that countless others have suffered through this, so if there's a better thread for me to post in, please share.  Otherwise, I guess I try to start a thread with a slightly more accurate title.

 

0
Vladimir Iliev
Telerik team
answered on 15 Apr 2015, 07:28 AM
Hello Evan,

Thank you for the last clarification - please note that for the cases when the value is not persisted after editing (which can be observed when the initial value of the field is null), the "valuePrimitive" option of the DropDownList was implemented in Q2 2013 release. This approach can be used to avoid the default value binding behavior to update the field with the selected item when the initial value is null.

Also opening another thread on current topic would not be needed as the topic is discussed multiple times (e.g.: here).

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Evan
Top achievements
Rank 1
Answers by
Evan
Top achievements
Rank 1
Phil
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or