-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Joseph A Moraes
Message 5 in Discussion
Hi Preeti, Looking into the following Sample Code. <asp:datagrid id="dgType"
runat="Server">
<columns>
<asp:boundcolumn datafield="Type"/>
<asp:templatecolumn>
<itemtemplate>
<asp:dropdownlist id="typelist" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem>Type1</asp:ListItem>
<asp:ListItem>Type2</asp:ListItem>
<asp:ListItem>Type3</asp:ListItem>
</asp:dropdownlist>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
Private Sub dgType_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'Assume you have stored Type Data from Database and put in DataSet oDs which has
one table with atleast a Column "Type"
dgType.DataSource = oDT
dgType.DataBind()
End Sub
Private Sub dgType_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgType.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim cboTemp As New DropDownList()
cboTemp = e.Item.Cells(1).FindControl("typelist")
if e.Item.Cells(0).Text = "Type1" then
cboTemp.selectedIndex = 2
else e.Item.Cells(0).Text = "Type2" then
cboTemp.selectedIndex = 3
else e.Item.Cells(0).Text = "Type3" then
cboTemp.selectedIndex = 4
end if
End If
End Sub - Joseph.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]