This is a migrated thread and some comments may be shown as answers.
VB Syntax for .Editable(False)
1 Answer 2 Views
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 18 Jun 2020, 01:02 PM

Hi, I'm new in Telerik and currently using VB.net for my code. Can someone help to convert the below code to vb in vbhtml?

.DataSource(dataSource =>
    dataSource.Ajax().Read("AjaxInitGrid", "Shared").Model(model =>
    {
        model.Id(p => p.ID);
        model.Field(p => p.CreationDate).Editable(false);
           model.Field(p => p.BirthDate).Editable(false);
    })
)

 

I not able to convert model.Field(p => p.CreationDate).Editable(false) to vb.

Thanks.

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 22 Jun 2020, 09:47 AM

Hi Alex,

The following snippet shows how to declare the model in VB and set Editable false to a field:

    @Code
        Html.Kendo().Grid(Of OrderViewModel)() _
            .Name("grid") _
            .Columns(Sub(columns)
                         columns.Bound(Function(p) p.OrderID).Filterable(False)
                         columns.Bound(Function(p) p.Freight)
                         columns.Bound(Function(p) p.OrderDate).Format("{0:MM/dd/yyyy}")
                         columns.Bound(Function(p) p.ShipName)
                         columns.Bound(Function(p) p.ShipCity)
                     End Sub) _
            .Pageable() _
            .Editable(Sub(ed) ed.Mode(GridEditMode.InCell)) _
            .Sortable() _
            .Scrollable() _
            .Filterable() _
            .HtmlAttributes(New With {.style = "height:550px;"}) _
            .DataSource(Sub(dataSource)
                            dataSource _
                            .Ajax() _
                            .PageSize(20) _
                            .Read(Function(read) read.Action("Orders_Read", "Grid")) _
                            .Model(Sub(m)
                                       m.Id(Function(i) i.OrderID)
                                       m.Field(Function(p) p.OrderDate).Editable(False)
                                   End Sub)
                        End Sub) _
            .Render()
    End Code

I added such a line in our VB syntax example for Grid as well and it should be live soon.

Regards,
Dimitar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or