ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Display image of user in awesome Grid in MVC
Title:
B
I
{code}
?
Hello Guys, I am new to awesome Grid, so little bit confuse about how to show user picture with their name in awesome Grid. i had google it couldn't find any satisfied answer. please suggest any possible solution. Thanks in Advance
Save Changes
Cancel
jay
asked at 23 Jul 2015
Answers
B
I
{code}
?
it could be done using Column.ClientFormat like this: new Column { ClientFormat = "<img src='.(ImgUrl)' alt='.(Name)'/> .(Name)" }, the above lines presumes that your Grid model has ImgUrl and Name properties the GridModel is the T from GridModelBuilder<T> but if you use GridModelBuilder.Map the GridModel is the result type of the Map function which most of the time (always in the demos) is an anonymous object so at the server side you could have something like this: return Json(new GridModelBuilder<Customer>(Db.Customers.AsQueryable(), g) { Map = o => new { o.Name, ImgUrl = Url.Content("~/pictures/" + o.ImgFileName), ... } });
Save Changes
Cancel
Omu
answered at 23 Jul 2015
yeahhh its working, Thanks for Help.
at 23 Jul 2015
jay
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK