Groups | Blog | Home
all groups > asp.net datagrid control > october 2004 >

asp.net datagrid control : About of DataGrid, RadiButtonList and DropDownList From Mexico City


Ricardo Ostos {MX}
10/29/2004 10:04:09 AM
Hi, friends as are wishing them the best thing to them of this life.

I have:
VS .NET Pro 2003
Win 2000 Pro with SP4
Sql Server 2000 with SP3
Developer Web, with C#


I have a DataGrid where I show all my products I have a column of
Templete type, where I show a RadioButtonList, depending where the client
wishes that its product is given to him, have 5 options, depending on the
option I must show a DropDownList of the possible options.

It already manages to be able to capture the events of the
RadioButtonList, and its changes, what I have not been able now to do is
to be able to add the data to my DropDownList from the data base.

I am handling a single DropDownList to perfomance for application.

I have not been able to do that my DropdownList this
qualifying and later to give of discharge the registries him.

I have this code when the RadioButtonList changes of value:

public void Modifica1 (object sender, EventArgs e)
{
string TextoRB = "";
RadioButtonList rb = new RadioButtonList();
rb = (RadioButtonList) sender;

TextoRB = rb.SelectedItem.Value;

DropDownList lst = new DropDownList();
lst.FindControl("lstGeneral");

TextBox txt = new TextBox();
txt.FindControl("txtDireccion");


switch (TextoRB)
{
case "1":
lst.Enabled = true;
lst.Items.Add("Distribuidora");
txt.Text = "Distribuidora";
break;
case "2":
lst.Enabled = true;
lst.Items.Add("Domicilio Conocido");
txt.Text = "Domicilio Conocido";
break;
case "3":
lst.Enabled = true;
lst.Items.Add("Otra Distribuidora");
txt.Text = "Otra Distribuidora";
break;
case "4":
lst.Enabled = true;
lst.Items.Add("Carrocera");
txt.Text = "Carrocera";
break;
case "5":
lst.Enabled = true;
lst.Items.Add("Otro");
txt.Text = "Otro";
break;
}
}

The page does not mark ningun error to me but it does not add the data
either to me, I am testing as much with the DropDownList as with a TextBox
and no me it respects them.

Some idea?
Beforehand I appreciate its attention to them.
Greetings from Mexico City.

P.D. Excuse my english is not absolutely good.

Ricardo Ostos {MX}
10/29/2004 4:30:05 PM
I have solution.

Add this code:
DataGridItem dgi = (DataGridItem) rb.Parent.Parent;
DropDownList lstGeneral = (DropDownList) dgi.FindControl("lstGeneral");
TextBox txtDireccion = (TextBox) dgi.FindControl("txtDireccion");

Show the control and modify class and everithing.

Greetings from Mexico City.

"Ricardo Ostos {MX}" <brcordova@hotmail.com> escribió en el mensaje
news:ucjJficvEHA.1300@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button