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

[Solved] Having many problems

1 Answer 26 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.
Andrew
Top achievements
Rank 1
Andrew asked on 04 Mar 2011, 07:36 PM
Hi there,

So we are using MVC3 with Razor. I am having lots of problems with this code.
For starters, it's not displaying properly, which makes no sense to me, it looses the header and footer styling and doesn't keep column width (even when I set the column width).
Second, I need to be able to select a row, fire off some javascript/jquery with the id from the row selected. But I can't get the control to recognize the clicks in the first place. All my javascript function does is show an alert with standard text, so that's not the issue.
Here is my code;

@Html.Telerik().Grid(Model).Name("Users").Columns(columns =>{
                            columns.Bound(o => o.LastName);
                            columns.Bound(o => o.FirstName);
                            columns.Bound(o => o.UserName);
                            columns.Bound(u => u.Company);
                            columns.Bound(u => u.Audience);
                            columns.Bound(u => u.BusinessLine);
                        }).Scrollable().Pageable(pager => pager.Style(GridPagerStyles.Numeric)).ClientEvents(events => events.OnRowSelect("rowSelected")).RowAction(row =>
                        {
                            row.Selected = row.DataItem.FirstName.Equals(ViewData["FirstName"]);
                        })

I am really new to Telerik controls, so this is all new to me. The worst part about all this is that if I add ".Selectable()" it gives off compiler errors. 

ANY help anyone can give will be extremely helpful.

1 Answer, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 04 Mar 2011, 11:35 PM
Really important. The documentation is pretty sparse and not congruent.  Apparently, I need to have the .DataKeys property set properly for the .Selectable() property to work. And I still cannot select this. Something is REALLY wrong with this. Need some help badly.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Share this question
or