Results 1 to 7 of 7

Thread: How to set validation icon in data cell?

  1. #1

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Question How to set validation icon in data cell?

    Hi...

    I want to set Column Error icons to display them in data cells when it value changed to 5 and less…

    I’ve try these codes but it seems they are not working ?!

    Code:
    Partial Class dataDataSet
        Partial Class STOREDataTable
    
            Private Sub STOREDataTable_ColumnChanging(ByVal sender As Object, ByVal e As System.Data.DataColumnChangeEventArgs) Handles Me.ColumnChanging
                
    If (e.Column.ColumnName = Me.columnItem_Quantity.ColumnName) Then
                    If CType(e.ProposedValue, Short) <= 5 Then
                        e.Row.SetColumnError(e.Column, "Quantity must be greater than 5")
                    Else
                        e.Row.SetColumnError(e.Column, "")
                    End If
                End If
            End Sub
        End Class
    
    End Class
    -----------------------------------------------------------
    Table name: STORE
    Field name (to be monitored for low Quantity): Item Quantity
    -----------------------------------------------------------

    Any ideas please…

    Regards...
    Last edited by HOTFIX; Dec 14th, 2008 at 12:51 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to set validation icon in data cell?

    Um, the DataTable is not a visual element so you can't set any kind of icons in it. If you're saying that you've bound that table to a DataGrid or DataGridView then you'd have to handle the appropriate event(s) of that grid and then set the appropriate property or call the appropriate method of that grid or its cell.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to set validation icon in data cell?

    Quote Originally Posted by jmcilhinney
    Um, the DataTable is not a visual element so you can't set any kind of icons in it. If you're saying that you've bound that table to a DataGrid or DataGridView then you'd have to handle the appropriate event(s) of that grid and then set the appropriate property or call the appropriate method of that grid or its cell.

    I’ve seen a tutorial from msdn website to “How Do I: Add Validation” by this link: http://msdn.microsoft.com/en-us/vbasic/bb643821.aspx

    But Unfortunately I couldn’t know how to me it works with my project!?


  4. #4

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to set validation icon in data cell?

    UP



    anybody can help me PLZ

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to set validation icon in data cell?

    If you can't explain what the issue is then I can't help. I for onw will not be downloading projects or watching videos. I already said this:
    If you're saying that you've bound that table to a DataGrid or DataGridView then you'd have to handle the appropriate event(s) of that grid
    and you've not even indicated whether you are using a grid or not.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to set validation icon in data cell?

    Quote Originally Posted by jmcilhinney
    If you can't explain what the issue is then I can't help. I for onw will not be downloading projects or watching videos. I already said this:and you've not even indicated whether you are using a grid or not.
    Thanks jmcilhinney for your support...

    I’m using grid view by dataset.xsd

    About the appropriate event I’m not sure I’m using the correct one! Because I’m using the data gird view in this project for navigation only

    Regards...
    Last edited by HOTFIX; Jan 9th, 2009 at 08:13 AM.

  7. #7

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to set validation icon in data cell?



    UP

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