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

[Solved] Column Referencing Issue in In-Cell Editing

3 Answers 83 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.
Abigail
Top achievements
Rank 1
Abigail asked on 22 Jun 2011, 11:48 PM
I recently switched the below grid from in-line editing to in-cell editing.

Ever since then, I've gotten javascript errors that prevent the SpeedDialLabel from displaying correctly:

"ButtonNumber is not defined"

How can I reference ButtonNumber from the SpeedDialLabel in a way that won't cause the above error?

                var grid = Html.Telerik().Grid<M5Portal.Models.SpeedDialModel>()<br>
                    .Name("SpeelDialGrid")<br>
                    .ToolBar(commands =><br>
                    {<br>
                        commands.SubmitChanges();<br>
                    })<br>
                    .DataBinding(dataBinding => dataBinding.Ajax()<br>
                        .Select("SpeedDialBinding", "Profile")<br>
                        .Update("SpeedDialEdit", "Profile")<br>
                        .Delete("SpeedDialDelete", "Profile")<br>
                    )<br>
                    .Columns(columns =><br>
                    {<br>
                        columns.Bound(o => o.ButtonNumber).Width(40).Title("");<br>
                        columns.Bound(o => o.SpeedDialLabel).ClientTemplate("<# if(3 > ButtonNumber) { #><strong><# } #><#= SpeedDialLabel#><# if(3 > ButtonNumber) { #></strong>&nbsp&nbsp<img tooltip=\"Cannot assign speed dials to first two lines.\" src=\"/Content/Images/tooltip.png\" class=\"m5-tooltip-image\"><# } #> ");<br>
                        columns.Bound(o => o.Number);<br>
                    })<br>
                    .ClientEvents(action => action.OnEdit("onGridEdit").OnDataBound("onDataBound"))<br>
                    .Editable(editing => editing.Mode(GridEditMode.InCell))<br>
                    .DataKeys(key => key.Add("ButtonNumber"))<br>
                    .Scrollable(c => c.Height("300px"));<br>
                grid.Render();<br>
            %>

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Jun 2011, 07:19 AM
Hi Abigail,

 I think this may be due to a bug which we have fixed already. The hotfix is available in the latest internal build to customers owning a commercial license. It will appear in the open source version in our next major release which is due in July.

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
Abigail
Top achievements
Rank 1
answered on 23 Jun 2011, 05:02 PM
Thank you for your reply.

I want to make the top two rows in a telerik grid display specific text, regardless of the actual contents of the grid.

Previously, I did this by adjusting the ClientTemplate of SpeedDialLabel based on the value of ButtonNumber.

Since I can no longer reference ButtonNumber, do you have any recommendations as to how I could accomplish my goal?
0
Atanas Korchev
Telerik team
answered on 24 Jun 2011, 07:21 AM
Hello Abigail,

The only thing I can suggest is to use inline editing mode until we update the open source version of Telerik Extensions for ASP.NET MVC.

All the best,
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
Abigail
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Abigail
Top achievements
Rank 1
Share this question
or