Hi, and thanks in advance.
* What do you use for data source, and what do you do to filter it?
Protected Sub ListBoxSelectRCP_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles
ListBoxSelectRCP.SelectedIndexChanged
If ListBoxSelectRCP.SelectedIndex + 1 = 1 Then
DetailsViewMain.DataSourceID = "roomFind1"
ListBoxSelectPatient.DataSourceID = "Patientfind1"
ListBoxSelectRoom.DataSourceID = "RoomFind1"
End If
If ListBoxSelectRCP.SelectedIndex + 1 = 2 Then
DetailsViewMain.DataSourceID = "roomFind2"
ListBoxSelectPatient.DataSourceID = "Patientfind2"
ListBoxSelectRoom.DataSourceID = "RoomFind2"
End If
TotalRecords.Text = DetailsViewMain.DataItemCount & " records"
End sub
"Göran Andersson" <gu***@guffa.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
It appears that you are reading the DataItemCount property before the
filtering takes effect.
What do you use for data source, and what do you do to filter it?
Monty wrote: Hi there, I have a simple medical database with patient records. I use:
TotalRecords.Text = DetailsViewMain.DataItemCount & " records" to reflect
the number of patients in the db.
I then filter the records per person and update the count with the same
code. My problem is that the actual number of records is always off by
one update. That is to say that initially it reads correctly say 25
records. Then I filter for person1 which has 3 records. The TotalRecords
will read 25 the first time, then I filter for person2, which should read
4 but it reads 3. Very strange! Any help with this?
Is there a way to cause an update/postback whatever to get the correct
number consistantly?
Thank you, Mark