c# - Selecting a Table Cell -
i have table automatically generated based off of 2 grid values. able select each individual cell (not multiple cells), , on cell select, radwindow
should appear. selected cell's outer box should become bold. within radwindow radcolor
picker, , color picked change cell's background. looked @ bunch of examples of similar events online, because of lack of jquery
, js knowledge i'm unsure how go this.
my table looks this:
<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>
the code-behind table generation is:
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; (rowctr = 1; rowctr <= rowcnt; rowctr++) { // create new row , add table. tablerow trow = new tablerow(); (cellctr = 1; cellctr <= cellcnt; cellctr++) { // create new cell , add row. tablecell tcell = new tablecell(); tcell.text = rowctr + "" + cellctr; trow.cells.add(tcell); } table1.rows.add(trow); } }
see how work radgrid cells here: http://demos.telerik.com/aspnet-ajax/grid/examples/client/cellselection/defaultcs.aspx see how call function on main page inside radwindow here: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx can pass new color. or use contenttemplate of radwindow have color picker in same context: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html. store reference last clicked cell in global js var example. can done standard controls well, needto extract clicked cell event's target.
Comments
Post a Comment