Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET MVC > General Discussions > Bound column defaults to invisible

Not answered Bound column defaults to invisible

Feed from this thread
  • oliwa avatar

    Posted on Jan 26, 2012 (permalink)

    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"))
    )

    Reply

  • oliwa avatar

    Posted on Jan 26, 2012 (permalink)

    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?

    Reply

  • oliwa avatar

    Posted on Jan 26, 2012 (permalink)

    Sorry, this should be the the Grid forum.

    Reply

  • Daniel Daniel admin's avatar

    Posted on Jan 30, 2012 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET MVC > General Discussions > Bound column defaults to invisible