What does this mean and how can I fix it?

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

dgtsCustomers.GridColumnStyles(0).HeaderText = "Factory ID"
        dgtsCustomers.GridColumnStyles(0).Alignment = _
        HorizontalAlignment.Left

It probablly means you don't have anything in dgtsCustomers.GridColumnStyles, the index is -1.

Thanks, but I figured out what the problem was. Thanks for the response though!

the error occur when the invalid user try to login the system out of range index exception are occur in vb.net