Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
achile711

Registered:
Posts: 19
Reply with quote  #1 
Hi,
How to make button in datagrid visible or not based on cell.
For example : 
if etat aqual to validé delete button is disabled. Thank you
allow.jpg 

miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,713
Reply with quote  #2 
Handle the logic in the PreRender event for the table control row class.
__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
achile711

Registered:
Posts: 19
Reply with quote  #3 
Thank you,
Please can you give an example.
miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,713
Reply with quote  #4 

Public Class PackoutsTableControlRow
Inherits BasePackoutsTableControlRow

Protected Sub MyPreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
Dim bIsClosed As Boolean
Dim bIsPosted As Boolean

bIsClosed = IsStatusClosed()
bIsPosted = IsStatusPosted()

'../Images/icon_view.gif
Me.DeleteRowButton.Visible = (Not IsStatusClosed() And Not IsStatusPosted())

If bIsClosed Then
Me.AdjustRowButton.Visible = False
Me.PostRowButton.ImageUrl = "../Images/icon_edit.gif"

ElseIf bIsPosted Then
Me.AdjustRowButton.Visible = True
Me.PostRowButton.Visible = False
' Me.PostRowButton.ImageUrl = "../Images/icon_view.gif"
Else
Me.AdjustRowButton.Visible = False
Me.PostRowButton.ImageUrl = "../Images/icon_edit.gif"
End If

End Sub


__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
achile711

Registered:
Posts: 19
Reply with quote  #5 
I tried your example and this one but no good result, please can you help me 


Public Class ArchiveTableControlRow
Inherits BaseArchiveTableControlRow
Protected Sub MyPreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender

if me.Etat.Text = "Validé" then
me.ArchiveRowDeleteButton.Visible = False

Else
me.ArchiveRowDeleteButton.Visible = true
end if
end sub

miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,713
Reply with quote  #6 
What happens? Are you sure the ArchiveRowDeleteButton Text is equal to "Valide"? You should be using Visual Studio to debug these sorts of things, you can't do it easily just in Iron Speed.
__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
achile711

Registered:
Posts: 19
Reply with quote  #7 
Ok , I will try VS thank you
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement