On Jun 6, 8:43 pm, "Riki" <r...@dontnagme.comwrote:
Just make sure that your linkbutton has the property CommandName="Edit".
--
Riki
<a...@mailinator.comwrote in message
news:bc**********************************@e53g2000 hsa.googlegroups.com...
Hi folks,
I've got a LinkButton that's being added to the GridView under certain
circumstances, conditionally.
Whenever the link is clicked, I would like to put the row (that
contains the link) in edit mode.
Please note that I'm trying to do this dynamically, in the run-time.
Any help would be highly appreciated,
Thanks
Jack
Well, I did so, but it doesn't work yet. Here's the code:
LinkButton lblOptions = new LinkButton();
lblOptions.CommandName = "Edit";
lblOptions.CausesValidation = false;
lblOptions.ID = "lblOptions" + id;
lblOptions.Text = String.Format("<span style='margin-left:10px;'></
span>{0} other options", total);
lblOptions.Style.Add(HtmlTextWriterStyle.Color, "black");
lblOptions.Style.Add(HtmlTextWriterStyle.FontWeigh t, "bold");
lblOptions.Style.Add(HtmlTextWriterStyle.FontSize, "7pt");
row.Cells[3].Controls.Add(lblOptions);
Pressing the link doesn't put the row in Edit mode!
Any idea?