Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithRowCssClassExpression #185

Open
barrufeto opened this issue May 7, 2019 · 1 comment
Open

WithRowCssClassExpression #185

barrufeto opened this issue May 7, 2019 · 1 comment

Comments

@barrufeto
Copy link

Hi.

Us possible to assign this property reading a property from a table in the database? A query executed there...or a from a session value,

Thanks!

@barrufeto
Copy link
Author

I'll explain better now with my laptop...

We have something like this in the code:

WithRowCssClassExpression(x => (x.Enabled == true) ? "info" : "danger" )

And it works fine accessing the info defined in the line MVCGridDefinitionTable.Add("InOutUserGrid", new MVCGridBuilder<vst_InOut>()

Now..imagine we want to write the condition of the WithRowCssClassExpression accessing our BD (with Entity Framework) and the idea is execute something like:

WithRowCssClassExpression("SQL Query to get the Enabled property of the register" == true) ? "info" : "danger" )

I want to do this because in the view I use (vst_InOut), I don't want to create a complex SQL sentence.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant