chech if DataGrid is null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chriskaza81
    New Member
    • Nov 2007
    • 52

    chech if DataGrid is null

    hello how can i check if my DataGrid is null? i mean if it has no binded data yet.. how can i check this???
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi ,

    You can check if datagrid is bind to any data source or not by using its Item property.
    e.g.
    If( Datagrid1.Items .Count =0) Then
    '' other code if datagrid is not binded to data
    End If


    Originally posted by chriskaza81
    hello how can i check if my DataGrid is null? i mean if it has no binded data yet.. how can i check this???

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      You could also check if it's DataSource property is null. (Or the bindingsource property too?)

      Comment

      Working...