extensión nueva para dropdownlist

This commit is contained in:
2023-01-28 07:10:42 -07:00
parent 1d3fea7607
commit 40063d03fd

View File

@@ -3468,6 +3468,22 @@ Namespace Extensiones
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub SelectedTextExist(Obj As DropDownList, Valor As Object)
If (Obj.Items.FindByText(Valor.ToString()) IsNot Nothing) Then Obj.SelectedValue = Obj.Items.FindByText(Valor.ToString()).Value
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub SelectedTextLikeIfExist(ByRef Rbl As DropDownList, ByRef Valor As String)
If Valor <> "" Then
For Each item As ListItem In Rbl.Items
If item.Text.Contains(Valor) Then
item.Selected = True
End If
Next
End If
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub SelectedValuesIfExist(ByRef Rbl As RadioButtonList, ByRef Value As String)
Try
Dim valores As String() = Value.Split(CType(",", Char()))