Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, July 1, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: hiding the delete link in datagrid for some rows
NagaratnaPandi
Posts: 111
 
hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 7:59 AM
Hi all,

I have created a datagrid in quickform and i have delete button .Now i want to hide the delete button but in some rows based on one condition.How can i do this?

Thanks,
Pandi
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 8:21 AM
The best place is probably on the OnRowDataBound event of the Grid.
You need to then find the Delete Column, then get the Link Button out of the Column's list of control (for each row) and based on your conditions Remove it.

I have done something similar where based on certain conditions, the Link goes away, or I change the caption (The Edit Button becomes "Save" and the Delete becomes "Cancel" while doing Inline Editing on the grid)...

For an Out of the Box example, look at the AccountMarketing.ascx.cs. The RowDataBound handler gets a reference to the LinkButtons and then adds confirmation Javascript. As stated, I have used this event to Implement Inline Editing as well.
[Reply][Quote]
NagaratnaPandi
Posts: 111
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 8:41 AM
Hi Raul,

I don't have any .cs file in my quickform.How can i access the OnRowDataBound event of the Grid in quickform (Not the customized form).

Thanks,
Pandi
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 9:49 AM
2 Things:

If you are working with a QuickForm, you probably will have to detach it and convert it into a Custom Form:
- Deploy uncompiled, Copy the ascx from the Deployment folder. Then drop the Quick Form and add the File onto the correct directory under Support Files/SmartParts.

Once you have an ascx file, you could either modify it to add a Code behind file (.cs) or just put in a script tag for Server code and add your event handlers directly to the ascx file.



[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 12:23 PM
Another option is to code an OnBeforeDelete business rule for your entity and pop an error message that the row cannot be deleted. The button would still be there, but at least the row would not be deleted. Simply throw an exception in your OnBeforeDelete to prevent the delete from happening when your condition is met:

throw new Sage.Platform.Application.ValidationException("Delete is not allowed.");
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 09 11:21 PM
Mike:

At least personally, I tried to shy away from server side validation when possible to Improve performance while using the Page (yes, you trade some performance on rendering, but depending on the User's connectivity, sometimes the latency effect even on Async calls is quite bad).

I have seen pages where every single field had some sort of Server side validation/formatting. Off course, the Developer never felt the delays because they always ran the client on the Server (or on a machine on a LAN with good speed access to the server). Once the form was released, the End users quickly started complaining that it took them several minutes to complete the form, and upon further review I quickly discovered what was going on.

That being said, for a grid your approach may not contribute the same effect as there probably will be few trips to the server (plus the actual Delete still would've required a Call to the Server anyways).
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 09 6:53 AM
If there is aleady a delete column in the grid then then OnRowDataBound event will already do the introspection for the column and add the javascript confirmation message. You will need to do a smart part since this event is not exposed through AA and is code generated by default. As Raul stated, deploy the site as uncompiled (ensure precompile is not selected). You can then load your website into Visual Studio and make the changes required. Note that smartparts that are generated from AA will be the combilned HTML markup and the C# code. Your smartpart will be .ascx. I usually take a moment and add a new csharp file in the same folder as the smart part and name it .ascx.cs. I will then copy the code out of the initial smart part and work a seperating the markup from then code and refactor until it works.

Mark
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: hiding the delete link in datagrid for some rowsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Dec 09 5:35 AM
You could actually put it all in the quickform if you are clever with the quickformload method. It depends who will be looking after the page once the customer gets hold of it (i.e. a quickform is a little easier to support if you are not a developer). You could end the quickformload, start a page_load, attach a rowdatabound event to the grid, code your rowdatabound event (remember to NOT put the closing curly bracket on as AA will do this for you when you build). once you have the "template" setup for doing this its easy to port to another screen. The girds are quite basic in AA, considering it inherits from a .NET datagrid this is a bit disappointing as there are loads of features you just dont get access to (if using AA of course...)
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/1/2025 1:13:05 PM