259
Views
2
Comments
Solved
[OutSystems Data Grid Web] Max and min date
outsystems-data-grid-web
Web icon
Forge asset by OutSystems

Hi,

It's possible to set a max and min date on the calendar from datagrid?


I tried to use 

ctl.min = newMinValue; ctl.max = newMaxValue;  ctl.value = wijmo.clamp(ctl.value, ctl.min, ctl.max); 

on the OSCellRenderes but with no success.


2020-08-31 15-57-57
Tiago Miguel Pereira
Staff
Solution

Hello David Rodrigues,

Thanks for bringing this subject to the discussion.

DataGrid component is currently not using a min and max values for setting a valid range on Date columns.

Nevertheless, I created a sample just to illustrate how you can accomplish that specific behavior, could you please check the sample attached to this message?

As a workaround, you can use the sample as an example. You will need to include a Web Block containing the method that you want to set the min and max values for the Dates. (This block is included in the sample attached)

Inside the Web Block you can see that we have a Javascript block containing a setTimeout. We need to wait for the grid to load the group panel otherwise, we will get an error. Feel free to create your own method.
Also, you can change the css in order to create a better experience and change the cursor, for instance.


Hope this sample is useful if you need to extend DataGrid to have the calendar limited within a specified range.

Tiago Pereira

DataGridDateRange.oml
2025-07-21 09-18-19
David Rodrigues

Tiago Miguel Pereira wrote:

Tiago Miguel Pereira wrote:

Hello David Rodrigues,

Thanks for bringing this subject to the discussion.

DataGrid component is currently not using a min and max values for setting a valid range on Date columns.

Nevertheless, I created a sample just to illustrate how you can accomplish that specific behavior, could you please check the sample attached to this message?

As a workaround, you can use the sample as an example. You will need to include a Web Block containing the method that you want to set the min and max values for the Dates. (This block is included in the sample attached)

Inside the Web Block you can see that we have a Javascript block containing a setTimeout. We need to wait for the grid to load the group panel otherwise, we will get an error. Feel free to create your own method.
Also, you can change the css in order to create a better experience and change the cursor, for instance.


Hope this sample is useful if you need to extend DataGrid to have the calendar limited within a specified range.

Tiago Pereira

 

 

 

 I think the upload of attachments isn't working.


I made it work with your screenshots anyway.


Thank you very much!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.