Here is what I got up to now
After you call DataBind on the dropdownlist, you can do this (C# syntax):
fctFillDropDownList(ddSource, 30, strSortAsc, dvTemp)
...'*************************************************************************
'*************************************************************************
Private Sub fctFillDropDownList(ByRef objControl As System.Web.UI.WebControls.DropDownList, _
ByVal iParentID As Int16, ByVal strSort As String, ByRef dvTemp As DataView)
'*************************************************************************
dvTemp.RowFilter = "parentId=" & iParentID
dvTemp.Sort = strSort
objControl.DataSource = dvTemp
objControl.DataTextField = "Texte"
objControl.DataValueField = "Texte"
End Sub
MyDropDownList.Items.Insert(0, new ListItem("", ""));
That will add a blank row at the beginning of the dropdownlist.
HTH
Thanks that worked
0 comments:
Post a Comment