Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can i use GC.Collect() ? Pin
Christian Graus2-Apr-07 21:59
protectorChristian Graus2-Apr-07 21:59 
GeneralRe: Can i use GC.Collect() ? Pin
JacquesDP2-Apr-07 22:03
JacquesDP2-Apr-07 22:03 
GeneralRe: Can i use GC.Collect() ? Pin
Scott Dorman2-Apr-07 14:44
professionalScott Dorman2-Apr-07 14:44 
QuestionRe: Can i use GC.Collect() ? Pin
Martin#2-Apr-07 21:24
Martin#2-Apr-07 21:24 
AnswerRe: Can i use GC.Collect() ? Pin
Scott Dorman3-Apr-07 1:05
professionalScott Dorman3-Apr-07 1:05 
GeneralRe: Can i use GC.Collect() ? Pin
Martin#3-Apr-07 4:05
Martin#3-Apr-07 4:05 
GeneralRe: Can i use GC.Collect() ? Pin
Martin#2-Apr-07 20:28
Martin#2-Apr-07 20:28 
QuestionSetting 'OnClick' for dynamic button in Code behind Pin
Chris McGlothen2-Apr-07 11:59
Chris McGlothen2-Apr-07 11:59 
All,

I've gotten myself stuck on this problem and I can't seem to find a solution.Confused | :confused:

I have an initial data bound radio button list(rbl) in a table that has an OnSelectedIndexChanged event that fires at the push of a button. Next I have the code that adds a child rbl and a button that would fire a subsequent OnSelectedIndexChanged for the child rbl.

My question is this - How do I set the OnClick event for the dynamically created button?

Yes I know that this could be solved with a tree view control, but I'm forced to write this code in 1.1 which doesn't have this control.

Here is the code -
<br />
public void rbLocation_OnChange(object sender, System.EventArgs e)<br />
		{<br />
			DBAccess OBJBO = new DBAccess();<br />
			DataSet BaseNodeSet = new DataSet();<br />
<br />
			//insert code to add new table row<br />
			Table tbl = new Table();<br />
			tbl = tblLoc;<br />
			TableRow tr = new TableRow();<br />
			TableRow tr2 = new TableRow();<br />
<br />
			int numRows = tbl.Rows.Count;<br />
			int iteration = numRows + 1;<br />
			tbl.Rows.AddAt(numRows,tr);<br />
			tbl.Rows.AddAt(iteration,tr2);<br />
<br />
			//adding tablecell info<br />
			TableCell td = new TableCell();<br />
			TableCell td2 = new TableCell();<br />
			TableCell td3 = new TableCell();<br />
			td.Width = 30;<br />
			tr.Cells.Add(td);<br />
			tr.Cells.Add(td2);<br />
<br />
			//adding the radiobuttonlist for the children<br />
			RadioButtonList rbChild = new RadioButtonList();<br />
			rbChild.Attributes["OnSelectedIndexChanged"] = "rbChild_OnChange()";<br />
			rbChild.DataTextField = "Description";<br />
			rbChild.DataValueField = "NodeID";<br />
			rbChild.ID = "rbChild" + iteration;<br />
			rbChild.DataSource = OBJBO.GetBaseNodes(Convert.ToInt32(rbLocation.SelectedValue),3,1,out BaseNodeSet);<br />
			rbChild.DataBind();<br />
			td2.Controls.Add(rbChild);<br />
<br />
			//maintain the selected parent value & disable parent radiobuttonlist<br />
			rbLocation.SelectedValue = rbLocation.SelectedValue;<br />
			rbLocation.Enabled = false;<br />
			btnOK.Visible = false;<br />
			<br />
			//add button that reverts to the parent radio list<br />
			tr2.Cells.Add(td3);<br />
			Button bk = new Button();<br />
			bk.ID = "btnBack";<br />
			bk.Text = "Previous Group";<br />
			bk.Attributes["OnClick"] = "btnBack_OnClick()";<br />
			bk.Visible = true;<br />
			td3.Controls.Add(bk);<br />
			<br />
						<br />
		}



An American football fan -
Go Seahawks!

Lil Turtle

QuestionScheduling (user input time = system time Pin
orly00132-Apr-07 11:37
orly00132-Apr-07 11:37 
AnswerRe: Scheduling (user input time = system time Pin
Judah Gabriel Himango2-Apr-07 13:06
sponsorJudah Gabriel Himango2-Apr-07 13:06 
AnswerRe: Scheduling (user input time = system time Pin
Leslie Sanford2-Apr-07 16:40
Leslie Sanford2-Apr-07 16:40 
QuestionClosing ComboBox DropDownList Programmatically Pin
freshonlineMax2-Apr-07 10:49
freshonlineMax2-Apr-07 10:49 
AnswerRe: Closing ComboBox DropDownList Programmatically Pin
Judah Gabriel Himango2-Apr-07 13:04
sponsorJudah Gabriel Himango2-Apr-07 13:04 
QuestionShowDialogue Pin
AAKAra2-Apr-07 10:32
AAKAra2-Apr-07 10:32 
AnswerRe: ShowDialogue Pin
Christian Graus2-Apr-07 12:26
protectorChristian Graus2-Apr-07 12:26 
GeneralRe: ShowDialogue Pin
AAKAra3-Apr-07 7:05
AAKAra3-Apr-07 7:05 
GeneralRe: ShowDialogue Pin
AAKAra3-Apr-07 7:25
AAKAra3-Apr-07 7:25 
QuestionHow to get to DVD drive without getting access to CD drive? Pin
Khoramdin2-Apr-07 10:16
Khoramdin2-Apr-07 10:16 
Questioncomputer name to IP address Pin
marwan_siala2-Apr-07 9:52
marwan_siala2-Apr-07 9:52 
AnswerRe: computer name to IP address Pin
stancrm2-Apr-07 19:44
stancrm2-Apr-07 19:44 
QuestionOpening UNKNOWN filename? Pin
Goalie352-Apr-07 9:18
Goalie352-Apr-07 9:18 
AnswerRe: Opening UNKNOWN filename? Pin
Christian Graus2-Apr-07 10:01
protectorChristian Graus2-Apr-07 10:01 
AnswerRe: Opening UNKNOWN filename? Pin
engsrini2-Apr-07 13:20
engsrini2-Apr-07 13:20 
QuestionPulling info from arrays Pin
JMOdom2-Apr-07 8:57
JMOdom2-Apr-07 8:57 
AnswerRe: Pulling info from arrays [modified] Pin
Christian Graus2-Apr-07 10:11
protectorChristian Graus2-Apr-07 10:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.