Hi Cathi,
I tried the following and it did not work.
'Attempt to load the dataset with Source Data.
Me.Personnel01_Ds1.Clear()
'Intialize Dataset for Personnel - Default values
Me.SqlDataAdapter1.FillSchema(Personnel01_Ds1, SchemaType.Source, "Personnel")
Me.SqlDataAdapter1.Fill(Personnel01_Ds1, "Personnel")
If Personnel01_Ds1.Tables("Personnel").Rows.Count > 0 Then
Me.dgPersonnel.SetDataBinding(Personnel01_Ds1, "Personnel")
Me.BindingContext(Me.Personnel01_Ds1, "Personnel").Position = 0
Else
Me.dgPersonnel.DataBindings.Clear()
End If
Me.SqlDataAdapter2.Fill(Personnel01_Ds1, "JobType")
Any other suggestions?
Thanks you Cathi and Bonnie.
Roland
====================================================================
>Bonnie,
>
>Thanks for pointing this out. My mistake in the code I posted.
>
>>Roland,
>>
>>I haven't used a grid, but I've data bound enough controls ... try setting the BindingContext Postion after you've set the DataBinding.
>>
>>~~Bonnie
>>
>>
>>>Hi Cathi,
>>>
>>>I tried the following and it did not seem to work.
>>>
>>> Me.SqlDataAdapter1.Fill(Personnel01_Ds1, "Personnel")
>>> Me.BindingContext(Me.Personnel01_Ds1, "Personnel").Position = 0
>>> If Personnel01_Ds1.Tables("Personnel").Rows.Count > 0 Then
>>> Me.dgPersonnel.SetDataBinding(Personnel01_Ds1, "Personnel")
>>> Else
>>> Me.dgPersonnel.DataBindings.Clear()
>>> End If
>>>
>>>The datagrid row position (the row > selector) still was on another position down the grid. Not on the first row.
>>>
>>>Any suggestions?
>>>
>>>Hope you had a good New Year!
>>>
>>>Thanks
>>>Roland
>>>
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only