• Welcome to the upgraded JDELIST forum and thank you for your patience.
    Please restrict discussions and issues regarding the new forum software to the Off Topic forum. We will be monitoring that forum for issues.
    If you have trouble logging in, please reset your password using the forgotten password form: https://www.jdelist.com/community/index.php?lost-password/
    If you are unable to successfully reset your password, please contact us: Click here!
    We hope that you enjoy the upgraded forum.
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Status of a Grid Column : Enabled/Disabled

OmmSai99

Member
Hello All,

Is there any standard function to check the status of a Grid column If its enabled or disabled at a certain position.

I mean , there are multiple validations in different event rule where a grid column has been enabled or disabled. i need to know if the Grid column is enabled or disabled at a certain moment/position , based on which i can write some more logic.

My New Requirement is
IF Grid Column is enabled
---DO this---
Else
---DO this---
End IF




Thanks
 

newjdedev1

Active Member
Hi, AFAIK this is not possible. But there is definitely some condition based on which grid column is enabled/disabled. You can use the same condition for your new ER.

So, if flag = Y,
disable grid column
---DO this---
else
---DO this---
End If
 

OmmSai99

Member
Thank you For your reply.

Yes i am doing the same , but the difficulties is , there are so many permutations and combinations of these conditions where this Grid column is enabled/disabled and its getting more difficult to replicate all these permutations and combinations of these conditions .

so was checking for other alternatives.


Thanks
 

JMR

VIP Member
If I understand your requirement, you might try modularizing all of your Grid Column enables and disables. Something like creating a hidden button for each of DisableColumn and EnableColumn. In the ER for each of those events, you set a global variable based on if enabling or disabling:

DisableColumn button pressed:
Code:
VA frm_GridColEnabled = "N"
DisableGridColumn system function
EnableColumn button pressed:
Code:
VA frm_GridColEnabled = "Y"
EnableGridColumn system function
You will need to replace all of the existing code where your column is being enabled and disabled to call the appropriate button code, and as long as you use that approach everywhere that column's enabled-state changes, you will have the one variable to which you can refer to check it's enabled-state.

There is no system function you can call that will just return that enabled-state to you programmatically.
 

BOster

Legendary Poster
Edit:
Got to second page of responses and realized JMR had all ready basically given the same resolution. Sorry for not reading the entire thread before responding, deleting my response.
 
Last edited:

OmmSai99

Member
Thank You Jeremy and Brian

My requirement is to perform some logic if the Grid column A ( Say) is disabled and perform some different logic If the Grid column A ( Say) is enabled.
that means at a certain moment ( Click a Row exit after selecting a Row ) i need to know the column A of the selected Row is enabled or disabled.


To Replace the exiting code or replicate the Exiting condition is very complex , as there are huge amount of logic written with lots of permutation and combination of conditions where the Column A is enabled/disabled. so its not possible to find exactly what are the conditions where the column A is enabled and where the column is disabled.

So looking for any alternative (Logic or Functions ) where to pass the selected row column and check the status ,its enabled or disabled.


Thanks
 

BOster

Legendary Poster
Yeah, you kind of have to start with the plan Jeremy outlined. Its a unfortunate that there isn't a way to read control state. I have ran into the same requirement on more than one occasion.
 

JMR

VIP Member
You don't have to replace/replicate the existing logic that determines the state. You would replace every DisableGrid<Column A> and every EnableGrid<Column A> system function calls with corresponding PressButton<DisableGrid> and PressButton<EnableGrid>. As long as you do that, the value of that global variable (VA frm_GridColumnEnabled for instance) can be checked anywhere in your code to "know" if the column is enabled or not.
 
Top