Skip to main content
14-Alexandrite
September 18, 2020
Solved

how to Add checkbox in grid to select rows in grid to pass the data to service?

  • September 18, 2020
  • 3 replies
  • 4639 views

hello,

i have added a checkboxes in a grid.

Bind the service to the grid and then i have bind EditedTable of grid to infotable input parameter(Workout_id) of the DB service to pass the Workout_id. 

 I set iseditable and multiselect property of grid to true, and also set the true value to editable in configure grid columns.

But after that the checkboxes has set default value true. I don't want default value true for checkboxes.

so is there any way where i can set default value false to checkboxes? here i have shared attachments, please refer for your better understanding.

 

Regards,

Ruchika

 

Best answer by sbt

So lets assume that GetInfoToGrid will return a infotable with the datashape has "Name" & "IsTrue" columns to the grid.

Your service output should be like

for(var i=0;i<5;i++)

{

var newEntry = new Object();

newEntry .Name= "somename";
newEntry .IsTrue = false; // always set to false when returned via service so that the check box is set to false
result.AddRow(newEntry1);

}

 

3 replies

15-Moonstone
September 18, 2020

Just ensure that the datatype of the column that you want to make it as checkbox is of type Boolean. Go to column rendering of the grid configuration and make it has checkbox.

If you want all the data rows set default to false, the data which is getting bound to grid should have the column set to false from the service itself. And you can use the edited table of the grid for further processing.

 

Thanks 

Ru_0114-AlexandriteAuthor
14-Alexandrite
September 22, 2020

Thanks for response,

I wanted to ask how i set default column value to false from service

 

sbt15-MoonstoneAnswer
15-Moonstone
September 22, 2020

So lets assume that GetInfoToGrid will return a infotable with the datashape has "Name" & "IsTrue" columns to the grid.

Your service output should be like

for(var i=0;i<5;i++)

{

var newEntry = new Object();

newEntry .Name= "somename";
newEntry .IsTrue = false; // always set to false when returned via service so that the check box is set to false
result.AddRow(newEntry1);

}

 

Community Manager
September 30, 2020

Hi @Ru_01.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community.

 

Regards.

 

--Sharon

Community Manager
October 16, 2020

Hi @Ru_01.

 

I have marked the Accepted Solution for this post.  If you disagree that it is the solution, please let me know.

 

Regards.

 

--Sharon