I've download your trial version and looking into your product for our company and was looking at the capabilities of the DataGrid. I'm trying to see if we can do the following.
Our data comes back from the DB in an employee class
3 of the properties are EmployeeID, FirstName and LastName
In one of the columns we would like to build a link which redirects to the EmployeeInfo page for the given employeeID, and as the Link we want to display the full name
So something like this
<a rel='nofollow' href="~/EmployeeInfo/?employeeID={EmployeeID}">{FirstName} + " " + {LastName}
But I can't figure out how to accomplish this using your control.
Thanks for any info.
So I actually was able to figure it out and got it working.
This works fine and I get a grid of employees no problem.
The other thing I'm struggling with is if the user selects Photo Display
When they do this we would display 3 photos per line with information under each photo like
Name, Title, Division , Department, Hire Date.
Can you do this with DataGrid or is it a different control altog
Based on the provided information we suspect that you are having a image in one of your column. When you click on the image you want the row to expand and show a detailed template where you want to display 3 images with information like Name, Title, Division , Department, Hire Date etc. You can achieve this using the detailed template feature of the EJ2 grid. We have discussed about this in detail in the below documentation.
Documentation: https://ej2.syncfusion.com/aspnetcore/documentation/grid/row/detail-template
Sample: https://ej2.syncfusion.com/aspnetcore/Grid/DetailTemplate#/bootstrap5
If this is not your requirement, kindly share the following details so that we may be able to assist you in a better way.
Please get back to us for further details.
So basically this would be the requirement. We are converting a Employee Directory classic ASP page to .NET Core.
The user can do a search based on a few parameters; First Name, Last Name, Department, Location
This displays the results which I was able to do fine with a DataGrid.
But the user can select a check box Display Photos.
This is turn would do something like the following;
With 3 photos per row and the employees info below their photo
Is this something you can do with DataGrid, or is this a different control. I'm in the process of evaluating your product and this is the one thing I still need to determine if you have a control for.
Hi Joseph,
Currently, we are validating your query, we will provide further details on or before 6th, April 2022. We appreciate your patience until then.
Regards,
Rajapandiyan S
We would like to get some more details on your requirement, please share the following details so that we may be able to provide a better solution ASAP.
We also want you to know that the DataGrid will be populated based on the fields used in the dataSource and we are not able to render the columns from a collection of array to perfectly render 3 objects of the array per row using DataGrid.
Please get back to us for further details.
So it's basically a page with 2 partial views
<div id="print-area">
@if (Model.DisplayPhotos)
{
<partial name="_EmployeePhotos" [email protected] />
}
else
{
<partial name="_SearchResults" [email protected] />
}
</div>
So the _SearchResults partial view is the DataGrid which works fine. The _EmployeePhotos is the other partial view which doesn't have to be a DataGrid if this wouldn't be the correct control to use. What I'm currently doing for this view is the following;
<tbody>
@{
var rowCount = 1;
<tr>
@foreach(var item in Model.Employees)
{
string[] rel='nofollow' href = @item.FNLName.Split('|');
<td class='celltext' width='300'>
<a rel='nofollow' href="/"><img width="175" height="175" alt="User Photo Not found" loading="lazy" onerror="this.style.display = 'none'" [email protected] /></a>
<div class='celllabel'>Name: <a rel='nofollow' href="@rel='nofollow' href[0]">@rel='nofollow' href[1]</a></div>
<div class='celllabel'>Title: @item.JobTitle</div>
<div class='celllabel'>Dept: @item.Department</div>
<div class='celllabel'>Div: @item.Division</div>
<div class='celllabel'>Hire Date: @item.DateOfLastHire</div>
</td>
rowCount++;
@if (rowCount == 4)
{
rowCount = 1;
@:</tr><tr>
}
}
</tr>
}
</tbody>
This works find but was wondering if you had a control which performed such a task. If not we still have this solution which works.
Based on the provided information we could see that you having two partial views and when you check the check box you want to hide the data grid and show photos as a tile view containing 3 photos per row.
We suggest you to use the Cards control with the tile view. Please refer the below demo and documentation for the tile view.
Demo: https://ej2.syncfusion.com/aspnetcore/Card/TileView#/fluent
Documentation: https://ej2.syncfusion.com/aspnetcore/documentation/card/getting-started
Please get back to us for further details.