gchq
gchq

Reputation: 1771

MVCGrid.net MVCGridConfig.vb example

Are there any examples available of MVCGrid.net using VB.NET?

Tried a number of methods, like this...

MVCGridDefinitionTable.Add("EmployeeGrid", New MVCGridBuilder(Of Person)().WithAuthorizationType(AuthorizationType.AllowAnonymous).AddColumns(Sub(cols)
cols.Add("Id").WithValueExpression(Function(p) p.Id.ToString())
cols.Add("FirstName").WithHeaderText("First Name").WithValueExpression(Function(p) p.FirstName)
cols.Add("LastName").WithHeaderText("Last Name").WithValueExpression(Function(p) p.LastName)
End Sub).WithRetrieveDataMethod(Function(options)
Dim result = New QueryResult(Of Person)()
Using db = New SampleDatabaseEntities()
    result.Items = db.People.Where(Function(p) p.Employee).ToList()
End Using
Return result
End Function))

... but something is really still adrift. Any pointers, or an example, would be much appreciated.

Thank you

Upvotes: 0

Views: 182

Answers (1)

gchq
gchq

Reputation: 1771

Have figured out part of it

MVCGridDefinitionTable.Add(Of GridModal)("CurrentBalanceGrid", New MVCGrid.Models.MVCGridBuilder(Of GridModal)().WithAuthorizationType(MVCGrid.Models.AuthorizationType.AllowAnonymous).AddColumns(Sub(cols)
                                                                                                                                                                                                           cols.Add("Id").WithValueExpression(Function(p) p.TransactionID.ToString())
                                                                                                                                                                                                           cols.Add("DebitAmount").WithHeaderText("Debit").WithValueExpression(Function(p) p.DebitAmount)
                                                                                                                                                                                                           cols.Add("CreditAmount").WithHeaderText("Credit").WithValueExpression(Function(p) p.CreditAmount)

Just need to wire up the data now

Upvotes: 0

Related Questions