Results 1 to 2 of 2

Thread: StrikeOut Items in ListBox Control

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    StrikeOut Items in ListBox Control

    Anyone know how I can StrikeOut certain items in a ListBox control?

    I'm trying to check and see if a certain row is Enabled, if it isn't then I want to StrikeOut that row, but my code is striking out the entire listbox.

    VB Code:
    1. Private Sub LoadJobRules(ByVal strJobID As String)
    2.    Dim dtRules As JHALibrary.ADORoutines.CDataTableAdvanced
    3.    Dim drRules As DataRow
    4.  
    5.    dtRules = mclsDML.dt_Get_Rules_By_JobID(strJobID)
    6.  
    7.    If dtRules.Rows.Count > 0 Then
    8.       lstRules.DataSource = dtRules
    9.       lstRules.DataValueField = "RuleID"
    10.       lstRules.DataTextField = "RuleName"
    11.  
    12.       For Each drRules In dtRules.Rows
    13.          If drRules("IsEnabled").ToString = "0" Then
    14.             [color=red]PROBLEM IS HERE[/color]
    15.             lstRules.Font.Strikeout = True
    16.          End If
    17.       Next
    18.  
    19.       lstRules.DataBind()
    20.    End If
    21. End Sub

    The first item is the only one disabled, therefore it should be the only item that is "Struck Through", but as you can see, all the items are this way.

    I know I need to tie into the item itself, but I'm not exactly sure how to do it.
    Attached Images Attached Images  
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width