Właściwość DataRepeater.DisplayedItemCount —
Pobiera liczbę DataRepeaterItem elementy, które mają być widoczne w DataRepeater kontroli, opcjonalnie w tym częściowo wyświetlane elementy.
Przestrzeń nazw: Microsoft.VisualBasic.PowerPacks
Zestaw: Microsoft.VisualBasic.PowerPacks.Vs (w Microsoft.VisualBasic.PowerPacks.Vs.dll)
Składnia
'Deklaracja
<BrowsableAttribute(False)> _
Public ReadOnly Property DisplayedItemCount ( _
includePartialItems As Boolean _
) As Integer
[BrowsableAttribute(false)]
public int this[
bool includePartialItems
] { get; }
[BrowsableAttribute(false)]
public:
property int DisplayedItemCount[bool includePartialItems] {
int get (bool includePartialItems);
}
[<BrowsableAttribute(false)>]
member DisplayedItemCount :
includePartialItems:bool -> int with get
Język JScript nie obsługuje właściwości indeksowanych.
Parametry
includePartialItems
Typ: BooleantrueAby uwzględnić częściowo wyświetlanych elementów do liczby; false do uwzględnienia tylko elementy w pełni widoczne.
Wartość właściwości
Typ: Int32
Liczba wyświetlanych elementów.
Uwagi
Ta właściwość służy do określenia, ile DataRepeaterItem elementy są widoczne w DataRepeater kontroli.
Przykłady
Poniższy przykład przedstawia sposób zwrócenia liczby elementów wyświetlanych w DataRepeater kontroli.
Private Sub Button1_Click() Handles Button1.Click
Dim msgString As String
Dim intFull As Integer
Dim intPartial As Integer
' Get the count without including partially displayed items.
intFull = DataRepeater1.DisplayedItemCount(False)
' Get the count, including partially displayed items.
intPartial = DataRepeater1.DisplayedItemCount(True)
' Create the message string.
msgString = CStr(intFull)
msgString &= " items are fully visible and "
' Subtract the full count from the partial count.
msgString &= CStr(intPartial - intFull)
msgString &= " items are partially visible."
MsgBox(msgString)
End Sub
private void button1_Click(System.Object sender, System.EventArgs e)
{
string msgString;
int intFull;
int intPartial;
string stringFull;
string stringPartial;
// Get the count without including partially displayed items.
intFull = dataRepeater1.get_DisplayedItemCount(false);
// Get the count, including partially displayed items.
intPartial = dataRepeater1.get_DisplayedItemCount(true);
// Create the message string.
stringFull = intFull.ToString();
msgString = stringFull;
msgString = msgString + " items are fully visible and ";
// Subtract the full count from the partial count.
intPartial = intPartial - intFull;
stringPartial = intPartial.ToString();
msgString = msgString + stringPartial;
msgString = msgString + " items are partially visible.";
MessageBox.Show(msgString);
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Używanie bibliotek pochodzących z częściowo zaufanego kodu.
Zobacz też
Informacje
Przestrzeń nazw Microsoft.VisualBasic.PowerPacks