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

Edit Link Href

5 Answers 100 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.
Shane
Top achievements
Rank 1
Shane asked on 03 May 2011, 09:43 PM
I have my grid set up like this:
@(Html.Telerik().Grid((IEnumerable<PhoneNumberViewModel>)Model.PhoneNumbers)
.Name("Phone Numbers")
.DataKeys(keys => keys.Add(c=>c.ID))
.DataBinding(dataBinding => dataBinding
    .Ajax()
    .Select("_SelectAjaxEditing", "AgencyPersonnel")
    .Update("_SaveAjaxEditing", "AgencyPersonnel"))
.Columns(columns =>
{
columns.Bound(a => a.ID).Title("ID");
columns.Bound(a => a.Number).Title("Phone Number").Width(20);
columns.Bound(a => a.Type).Title("Type").Width(10);
columns.Command(commands =>
{
    commands.Edit();    
}).Width(200);
})//.Groupable()
.Editable(editing => editing.Mode(GridEditMode.PopUp))
.Sortable()
.Filterable()
)

When I look at the edit link, it's always AgencyPersonnel/Index/2?Phone%20Numbers-mode=edit. Shouldn't it be going to the _SaveAjaxEditing controller action?  When I try to edit a phone number, it's just reloading the personnel with Id=2 instead.  
What am I doing wrong?
Thanks!

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 May 2011, 06:47 AM
Hello Shane,

 If clicking the edit link does not work as expected then you have probably missed to add a ScriptRegistrar to your page.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Shane
Top achievements
Rank 1
answered on 04 May 2011, 06:28 PM
I do have a ScriptRegistrar in the layout file, and the correct scripts are being included.  The issue appears to be that the grid itself is on an edit page.  So the initial page is /User/Edit/1, and the edit link for the second row in the grid looks like this: href="/User/Edit/2?AddressGrid-mode=edit".  Is there a way to have the edit link go to something like /User/EditAddress/2?
Thank you!
-Shane
0
Atanas Korchev
Telerik team
answered on 05 May 2011, 07:03 AM
Hi Shane,

 That url is used only when the grid us bound server side. The fact that the grid does not enter edit mode when you click the edit link indicates some client-side problem. Unfortunately I can only guess what it is unless I somehow reproduce it. It could be a JavaScript error, it could be a known problem with nesting an editable grid inside a <form> tag (which is not supported). Is there a chance to send us a sample project?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Shane
Top achievements
Rank 1
answered on 05 May 2011, 04:19 PM
I am in fact using server side binding when I see that behavior.  
I have switched to client side binding (which I was going to be doing anyway) and everything seems to work fine with the edit.

I am seeing another issue now though.  When I click the add new record button it brings up the add screen for the object correctly.  If I use the cancel button at the bottom everything works fine.  If I use the x in the title bar, then open the add screen again, the save and cancel buttons no longer work (I can click them but nothing happens).  Do you know what could cause this issue?  Thanks!
0
Atanas Korchev
Telerik team
answered on 06 May 2011, 09:43 AM
Hello Shane,

 I am afraid you have discovered a bug. Fortunately we were able to fix it quickly. I have just uploaded a new internal build which incorporates the hotfix. I also updated your Telerik points.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Shane
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Shane
Top achievements
Rank 1
Share this question
or