Hi All,
I am trying to find an answer to my problem and couldn't find anything in the forums. Here's what I'm trying to do.
I have a RadGrid and the edit form is a user control. I am adding some link buttons dynamically at run time to the edit form in Grid's Item Created event. These link buttons will be used to download different files. Here's my code to create the dynamic link button.
Thanks
Goksun
I am trying to find an answer to my problem and couldn't find anything in the forums. Here's what I'm trying to do.
I have a RadGrid and the edit form is a user control. I am adding some link buttons dynamically at run time to the edit form in Grid's Item Created event. These link buttons will be used to download different files. Here's my code to create the dynamic link button.
LinkButton lnkScriptFile = new LinkButton();
lnkScriptFile.ID =
"lnkScriptFile1";
lnkScriptFile.CommandName =
"DownloadAttachment";
lnkScriptFile.Text =
"Attachment " + (i + 1) + ": " + dtr["FileName"].ToString() + dtr["Extension"].ToString();
lnkScriptFile.CommandArgument = dtr[
"StageFileId"].ToString();
lnkScriptFile.OnClientClick =
String.Format(@"{0}.__doPostBack(""{1}"",""{2}"");", RadAjaxManager1.ClientID, lnkScriptFile.UniqueID, lnkScriptFile.CommandArgument);
pnlScriptFiles.Controls.Add(lnkScriptFile); I am adding OnClientClick event handler to do a real postback when the button is clicked. But I also need to invoke ItemCommand event of the grid. How can I do that?
Thanks
Goksun