
28/11/2005, 14:29
|
 | Colaborador | | Fecha de Ingreso: diciembre-2004
Mensajes: 1.802
Antigüedad: 20 años, 2 meses Puntos: 38 | |
Código:
Definicion del grid ... se agrega el combo como un template...dentro del grid
<asp:TemplateColumn HeaderText="Modo">
<ItemTemplate>
<asp:dropdownlist id="Dropdownlist2" runat="server" Height="14px" AutoPostBack="True" Font-Names="Verdana"
Font-Size="9px" OnSelectedIndexChanged="CambioEnComBoBox">
<asp:ListItem Value="1">Opcion 1</asp:ListItem>
<asp:ListItem Value="2">Opcion 2</asp:ListItem>
<asp:ListItem Value="3">Opcion 3</asp:ListItem>
</asp:dropdownlist>
</ItemTemplate>
</asp:TemplateColumn>
Manejador de evento.
protected void CambioEnComBoBox(object sender, System.EventArgs e)
{
DropDownList list = (DropDownList)sender;
TableCell cell = list.Parent as TableCell;
DataGridItem item = cell.Parent as DataGridItem;
/************ Valor seleccionado *******************/
string content = item.Cells[0].Text;
/************ Valor seleccionado *******************/
}
|