Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How do I hide or protect specific rows that have been returned from a drop down data window?

Posted on 2007-11-30
Medium Priority
Last Modified: 2013-12-26
I have a drop down data window that returns multiple rows.  I need to hide or protect some of the rows that have been returned.   I know that if I wanted to protect a column that is easily done in the properties of the column, but in my case here I only want to weed out specific rows.  Can I do this on a filter in some way?  I need to display these rows on initial retrieve, but then I do not want the user to be able to select them going forward.  
What I want to do is hide or protect any rows where my effective date is not the max effective date on the table for a specific customer.

Any help would be greatly appreciated.

Here is my select statement on the drop down data window:
select  Distinct dbo.tcu_cust.cust_name ,
		dbo.tcu_cust_address.address1 ,
 		dbo.tcu_cust_address.address2 ,
  		dbo.tcu_cust_address.city ,
  		dbo.tcu_cust_address.state ,
FROM    dbo.tcu_cust  with (index ( i_cust_01)), dbo.tcu_cust_addr_seq, dbo.tcu_cust_address
WHERE ( dbo.tcu_cust.cust_id = dbo.tcu_cust_addr_seq.cust_id )
and   ( dbo.tcu_cust_addr_seq.cust_id = dbo.tcu_cust_address.cust_id )
and   ( dbo.tcu_cust_addr_seq.address_seq_nbr = dbo.tcu_cust_address.address_seq_nbr )
and   ( dbo.tcu_cust_addr_seq.ship_to_addr = 'Y' )
and   ( dbo.tcu_cust.cust_type = 'PSOFT' )
and   ( dbo.tcu_cust.cust_status >= 'A' and dbo.tcu_cust.cust_status <= 'I' )
and   ( ( dbo.tcu_cust.ps_corp_cust_id
		in (select dbo.tcu_cust.ps_cust_id
			from dbo.tcu_cust
			where  dbo.tcu_cust.cust_id = :ai_cust_id))
		or ( dbo.tcu_cust.cust_id = :ai_cust_id )
		or	( dbo.tcu_cust.ps_cust_id
		in (select dbo.tcu_cust_add_relations.ps_site_id
			from dbo.tcu_cust_add_relations
			where  dbo.tcu_cust_add_relations.cust_id = :ai_cust_id)))
and   ( dbo.tcu_cust.ship_to_flg = 'Y' )

Open in new window

Question by:BlackBoxVS
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 14

Expert Comment

ID: 20385960
Ofcourse you can do with filter or by changing where clause....but still i am not clear about....
<I need to display these rows on initial retrieve, but then I do not want the user to be able to select them going forward.>

please clearify when exactly you want to filter out?

Author Comment

ID: 20395492
On my initial select from the drop down, I want to display all rows (both active and inactive customers), but when the user goes to click on a row from the list, I want them to only be able to choose from the active customers - so I want the inactive customers to be listed but not enabled.  Does this help?

LVL 14

Accepted Solution

sandeep_patel earned 375 total points
ID: 20396340
Ok..it's more clear now..
As you want to display and don't allow to select there is only option to write a script in itemchanged event of the datawindow.  Get the value from the column which says about active status and if it is not active RETURN 1 from the itemchanged event. Example script is given in Code Snippet.

Also I would suggest to display those rows in different color in DDDW by setting background/ foreground color property, so it would be easier for user to know it before selection.

And if you don't want to display the records itself then filter is the option.

// assumed that customer_id is the column to which dddw is attached and cust
// cust_id is the datavalue for dddw
// isactive is the column which says about the active status of the customer. If it's date you can take it as effective_date
datawindowchild child1
string ls_custid
long ll_row
// Get dddw reference
// Get datavalue from dddw
ls_custid = data
// search record for selected datavalue from dddw
ll_row = child1.Find('ps_cust_id = ' + ls_custid,1,child1.RowCount())
// If record found
If ll_row > 0 Then
   // Get value of column for decision making
   ls_isactive = child1.object.isactive[ll_row]
   // OR ld_eff_date = child1.object.effective_date[ll_row]
   // check value for decision
   If ls_isacgive = 'N' Then
   // If ld_eff_date <> max_date Then
      Messagebox('Invalid','Current selection for customer is not active')
      RETURN 1
   End if
End If

Open in new window

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 20400241
Just to add, if you want to hide them from the list instead of just enabling or disabling them what you can do is to put a script in the rowchanged event of the datawindow.

In the rowchanged you getthe datawindow child then you filter them accordingly. this way the "list" will change based on the row that is selected.

Hope this helps.


Author Comment

ID: 20412947
A new question - I am trying to use SetDetailHeight and set the height to 0 on the rows I want to hide.  When I step through debug, this works, but the change to the datawindow child does not seem to save - original height is still displayed.   Does the datawindow need specific settings for this to work?

Author Comment

ID: 20413143
I figured out my problem.  I have it working now.  Thanks for the suggestions.

Author Closing Comment

ID: 31412024
Thanks for the help.  I now have my datawindow child working using the setdetailheight option.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question