Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > dropdownlist in datagrid edit mode

Reply
Thread Tools

dropdownlist in datagrid edit mode

 
 
Luis Esteban Valencia
Guest
Posts: n/a
 
      09-29-2004
I need to put in the edit mode a dropdownlist with the correct value
selected.



On the template I have this

<ItemTemplate>
<asp:Label id=Label4 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.strTipoContrato") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>

<aspropDownList id="tipocontratot"
runat="server"></aspropDownList>
</EditItemTemplate>

On the codebehind I have this.

Private Sub dgpolizas_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
dgpolizas.ItemCommand

Select Case e.CommandName

Case "Edit"

dgpolizas.EditItemIndex = e.Item.ItemIndex

cargarpolizas()

Dim tipocontratot As DropDownList

tipocontratot = e.Item.FindControl("tipocontratot")

Dim myadp As New SqlDataAdapter("select * from tbltipocontrato", myconn)

Dim myds As New DataSet

myadp.Fill(myds, "tbltipocontrato")

tipocontratot.DataSource = myds.Tables("tbltipocontrato").DefaultView

tipocontratot.SelectedValue = ???

tipocontratot.DataBind()



Thanks



--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 2.
MIEMBRO ACTIVO DE ALIANZADEV


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formview dropdownlist won't populate in insert mode, but does in edit mode ??? jobs at webdos ASP .Net Web Controls 0 10-09-2006 03:38 PM
Would like to load a datagrid already in edit mode instead of having the user click the edit button Frank Kurka ASP .Net Datagrid Control 8 04-29-2005 09:33 AM
Datagrid DropdownList in edit mode??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 3 12-22-2004 06:01 PM
Adding a DropDownList to DataGrid dynamically in edit mode? =?Utf-8?B?RGF2ZQ==?= ASP .Net 2 12-17-2004 04:41 PM
TextBox and DropDownList in Datagrid Edit mode =?Utf-8?B?TmV3VG9Eb3ROZXQ=?= ASP .Net 2 02-09-2004 07:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57