PDA

View Full Version : multiple selection


Techno
06-03-2008, 06:11 AM
ok here is an odd one.
we are using ASP.NET to databind rows of data however we are creating a table and within that table, rows of entries and for each row, the column data, so yes, its basically an ASP.NET table, not the repeater or datagrid control.

They have also applied CSS to each row, so when you hover over it or select it, it will change color and enable certain buttons, thats cool

Now, the want to be able to say, select multiple rows of data. So, multiple tablerows. now, how is this possible, so the user can press "Control" key, and allow them to select multiple rows of data in the table? When selected, we also want it so that it appends data to a certain control, well, it does do this when you select a tablerow, but we also want this to work (appended to that control) when multiple tablerows have been selected

ideas?

Horus_Kol
06-03-2008, 06:17 AM
could we have a look at the source code... both the ASP stuff and the HTML/Javascript that is generated...

Techno
06-03-2008, 06:54 AM
sure but nothing fancy here.

ASP.NET

foreach(DataRow currentRow in dt.Rows)
{
TableRow row = new TableRow();
row.BackColor = OurFramework.Colors.FromColor(currentRow["color"].ToString());

...
...
TableCell cell = new TableCell();
cell.Text = currentRow["data"].ToString();

cell.Attributes.Add("onmouseout", "this.style.backgroundColor='" + ColorTranslater.ToHtml(deviceRow.BackColor) + "';");
cell.Attributes.Add("onmouseover", "this.style.backgroundColor='#FFFFB2';");
cell.Attributes.Add("onmousedown", "ClickRow(this);");
}


The ID is being stored in a hidden cell in that tablerow.

this is all we have and really is what you need to know :) We now want to implement it so that on the onmousedown, after doing our clickrow function, it will also append to this hidden field, some text, but also allowing other rows to be selected by pressing the control key