Footer Dropdwonlist Issue

G

Guest

I'm using a footer in my datagrid as an "add" row. I've read the current
postings and their links but am still having trouble adding the default of
"(select)" to the drropdownlist controls. I've tried:

mydddefectcodesF.Items.Insert(0, New ListItem("(please select)", ""))

mydddefectcodesF.Items.Insert(0, "Select One")
mydddefectcodesF.Items.FindByText("Select One").Value = 0
mydddefectcodesF.SelectedIndex = 0

in the Item created area, but no luck. I'm binding the dropdownlist via:

<FooterTemplate>
<asp:DropDownList id="dddefectcodesF" CssClass="gridtext" width="150"
DataSource="<%# BindDefectCodes() %>" DataTextField="DefectCode"
DataValueField="DefectCode_ID" runat="server" />
</FooterTemplate>

Public Function BindDefectCodes()

Dim objConn As SqlConnection = New SqlConnection(ConnectString)
Dim cmdDefectCodes As SqlCommand = New SqlCommand("SELECT DefectCode_ID,
DefectCode from view_DefectCodes", objConn)
cmdDefectCodes.CommandType = CommandType.Text
objConn.Open()
Return cmdDefectCodes.ExecuteReader(CommandBehavior.CloseConnection)

End Function

thanx!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top