我有一个基于两个 Grid 值自动生成的表。我希望能够选择每个单独的单元格(而不是多个单元格),并且在单元格选择时,RadWindow
应该出现一个。所选单元格的外框应变为粗体。RadWindow 中有一个RadColor
选择器,选择的颜色将改变单元格的背景。我在网上查看了一堆类似事件的示例,但由于我缺乏jQuery
JS 知识,我不确定如何去做。
我的表如下所示:
<asp:Table ID="Table1" runat="server" BorderStyle="Solid" BorderWidth="7px"
CellPadding="40" CellSpacing="15" Font-Bold="True" Font-Size="XX-Large"
GridLines="Both" HorizontalAlign = "Center">
</asp:Table>
表生成的代码隐藏是:
public void Generate_Matrix()
{
// Total number of rows.
int rowCnt = CCT.Rows.Count;
// Current row count.
int rowCtr;
// Current cell counter
int cellCtr = 0;
// Total number of cells per row (columns).
int cellCnt = LCT.Rows.Count;
for (rowCtr = 1; rowCtr <= rowCnt; rowCtr++)
{
// Create new row and add it to the table.
TableRow tRow = new TableRow();
for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
{
// Create a new cell and add it to the row.
TableCell tCell = new TableCell();
tCell.Text = rowCtr + "" + cellCtr;
tRow.Cells.Add(tCell);
}
Table1.Rows.Add(tRow);
}
}