C# equivalent to PHP example on "Permanent inline checkboxes"

C# equivalent to PHP example on "Permanent inline checkboxes"

rdmrdm Posts: 83Questions: 26Answers: 2

Because I'm trying to get a column checkbox in my table set up, I'm looking at the Permanent Inline Checkboxes blog post.

I have everything in place except for that little bit of server-side code.

Does anyone know the C# equivalent to this fragment?

Field::inst( 'active' )
            ->setFormatter( function ( $val, $data, $opts ) {
                return ! $val ? 0 : 1;
            } )

I also checked Formatters and looked for PHP to C# online converters. No luck there.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 43,572Questions: 1Answers: 5,708 Site admin
    Answer ✓
                        .Field(new Field("active")
                            .SetFormatter((val, data) => (string)val == "" ? 0 : 1)
                        )
    

    Should do it.

    Allan

Sign In or Register to comment.