logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Linq  
#1 Posted : Friday, November 26, 2021 11:25:15 AM(UTC)
Linq

Rank: Newbie

Groups: Registered
Joined: 11/26/2021(UTC)
Posts: 0
India

Thanks: 1 times
In my report I displayed datatable consists of employeeID, employeeName and Yes/No Questions.
For Yes, I want tick mark to be displayed.

EmployeeID EmployeeName IsActive IsFinished
1 SSS Yes No

Here, instead of Yes I want tick mark. Can anyone help me in this?
epf  
#2 Posted : Monday, November 29, 2021 8:13:35 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Hi, one option is to use the 'Cell Script' of your element.
Select your element in the model and edit the 'Cell Script' property:

Code:
@{
    ResultCell cell= Model;    
    if (!cell.IsTitle) {
        cell.FinalValue = "<input type='checkbox' " +  (cell.Value == "Yes" ? "checked" : "") + ">";
    }
}


This will generate a checkbox instead of the text.
Linq  
#3 Posted : Monday, November 29, 2021 12:58:44 PM(UTC)
Linq

Rank: Newbie

Groups: Registered
Joined: 11/26/2021(UTC)
Posts: 0
India

Thanks: 1 times
Originally Posted by: epf Go to Quoted Post
Hi, one option is to use the 'Cell Script' of your element.
Select your element in the model and edit the 'Cell Script' property:

Code:
@{
    ResultCell cell= Model;    
    if (!cell.IsTitle) {
        cell.FinalValue = "<input type='checkbox' " +  (cell.Value == "Yes" ? "checked" : "") + ">";
    }
}


This will generate a checkbox instead of the text.




Thanks for the reply. It worked. Is it possible to remove the checkbox border?

Edited by user Monday, November 29, 2021 1:33:50 PM(UTC)  | Reason: Not specified

epf  
#4 Posted : Tuesday, November 30, 2021 7:22:42 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
As it is just HTML.
You may try a simple checkbox got from https://getbootstrap.com/docs/3.3/components/

Code:
@{
    ResultCell cell= Model;    
    if (!cell.IsTitle) {
        cell.FinalValue = "";
        if (cell.Value == "Yes") {
            cell.FinalValue = "<span class='glyphicon glyphicon-ok' aria-hidden='true'></span>";
        }
    }
}


thanks 1 user thanked epf for this useful post.
Linq on 12/1/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.