Detail Table Link Opening
Click on a column on the Details Grid to open a link
The aim here is to host the links in the column on the detail table and to open the relevant page when the links are clicked.
A label object cannot be added to the detail table. A Radiobutton object can be added, but the Text value of this object is not kept in the database, so the data is not hosted.
The solution can be applied as follows to achieve the goal. According to the solution, when clicking on the CheckBox, the link will open.
A TextBox and a CheckBox are added to the form and added to the Detail Table. In Default, the Selected option of the CheckBox must be inactive. Care should be taken to ensure that the TextBox character length is long enough for the link to fit (For example, Lenght 2000 can be given as Single Line.) A link is hosted in the TextBox. If desired, the TextBox can be hidden, and the page of the link will be opened via the CheckBox using the data there. When the CheckBox is marked in the detail table, all the detail table rows can be navigated and the link in that row can be opened by adding 'href' to whichever CheckBox is checked. When the page opens, the CheckBox check is removed.
Transferring the link to the TextBox in the Detail Table
Similar to the structure below, the TextBox column that will contain the link in each row in the Detail Table can be filled.
((TextBox)DetailTable1.GetRowObject(DetailTable1.CurrentRowCount-1,"txtLink")). Text = externalSharelink;
Opening the link in the TextBox when clicking on the CheckBox in the Detail Table
The OnCheckedChanged method, which is triggered when the CheckBox is clicked, is used.
public void chkLink_OnCheckedChanged(Object sender, EventArgs e)
{
for (int i = 0; i ```<``` DetailTable1.CurrentRowCount; i++)
{
if (((CheckBox)DetailTable1.GetRowObject(i, "chkLink")). Checked == true) // chkLink CheckBox in the detail table
Page.Response.Write("```<```script```>```window.open('" + ((TextBox)DetailTable1.GetRowObject(i, "txtLink")). text + "','_blank');```<```/script```>```"); txtLink TextBox in Detail Table
((CheckBox)DetailTable1.GetRowObject(i, "chkLink")). Checked = false; The tick of the CheckBox in the detail table is removed again.
}
}
![](https://docsbimser.blob.core.windows.net/imagecontainer/Dosyay I%20open%20to%20click-84273ae5-0094-4852-936f-fb8fe4a72e79.png)