This is a migrated thread and some comments may be shown as answers.
Bound column defaults to invisible
3 Answers 26 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
oliwa
Top achievements
Rank 1
oliwa asked on 27 Jan 2012, 01:29 AM
I have a grid with a bound column that is a short data type and in order for it to show up I have to explicitly set the visibility to true.  Any ideas why this one column operates differently than the others?

@(Html.Telerik().Grid<AdminTrainingViewModel>()
        .EnableCustomBinding(true)
        .Name(string.Format("{0}Grid", Model))
        .DataBinding(x =>
                        {
                            x.Ajax().Select("GetGridData", "AdminTraining");
                            x.Ajax().Update("Deny", "AdminTraining");
                            x.Ajax().Delete("Approve", "AdminTraining");
                        }
        )
        .Columns(x =>
                    {
                        x.Bound(y => y.FullName);
                        x.Bound(y => y.TrainingStatusId).Visible(true);
                        x.Bound(y => y.RepCategoryName);
                        x.Bound(y => y.TrainingDate).Format("{0:MM/dd/yyyy}").Width(100);
                        x.Bound(y => y.Activity);
                        x.Bound(y => y.Purpose);
                        x.Bound(y => y.NumOfHours).Format("{0:#,##0.00}").Width(60);
                        x.Command(y => y
                                        .Custom("Approve")
                                        .Ajax(true)
                                        .Action("Approve", "AdminTraining")
                                        .DataRouteValues(z => z.Add(m => m.TrainingId).RouteKey("trainingId"))
                                        .ButtonType(GridButtonType.Image)
                            ).Visible(Model != TrainingStatus.Approved).Width(50);
                        x.Command(y => y.Edit().ButtonType(GridButtonType.Image)).Visible(Model != TrainingStatus.Denied).Width(50);
                    }
        )
        .Editable(x => x.Mode(GridEditMode.PopUp))
        .DataKeys(x => x.Add(y => y.TrainingId))
        .Pageable(x =>
                    {
                        x.PageSize(20);
                        x.Style(GridPagerStyles.Status);
                        x.PageOnScroll(true);
                    })
        .Sortable(x => x.OrderBy(y => y.Add(z => z.UpdateDate).Descending()))
        .ClientEvents(x => x.OnComplete("AdminTrainingGrid_OnComplete"))
        .ClientEvents(x => x.OnEdit("AdminTrainingGrid_OnEdit"))
)

3 Answers, 1 is accepted

Sort by
0
oliwa
Top achievements
Rank 1
answered on 27 Jan 2012, 03:20 AM
On a hunch I thought that maybe the column was being hidden because it is a foreign key so I added another column with the same data and it shows up as normal.  Why would a foreign key column be hidden by default?
0
oliwa
Top achievements
Rank 1
answered on 27 Jan 2012, 03:21 AM
Sorry, this should be the the Grid forum.
0
Daniel
Telerik team
answered on 30 Jan 2012, 12:26 PM
Hi Brian,

I posted my answer in the other forum thread you have opened. To avoid repetition, let's keep our communication in there.

Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
General Discussions
Asked by
oliwa
Top achievements
Rank 1
Answers by
oliwa
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or