|
Hi all,
i have a gridview in my project.
i need to pass the backcolor of a row to a javascript function and assign that backcolor to some other row in the javascript.
actually the requirement is,
i have to highlight(say yellow) a row on mouseover
that highlight to be removed(i.e., back to its original color) on mouseout
a row is highlighted with some other color(say green) on click.
here is the code im using for it.
<pre>
var previousRow;
var mouseOverBgColor;
var clickBgColor;
function ChangeRowColor(row)
{
//If last clicked row and the current clicked row are same
if (previousRow == row)
return;//do nothing
//If there is row clicked earlier
else if (previousRow != null)
//change the color of the previous row back to white
document.getElementById(previousRow).style.backgroundColor = clickBgColor;
//change the color of the current row to light yellow
document.getElementById(row).style.backgroundColor = "#80FF80";
//assign the current row id to the previous row id
//for next row to be clicked
previousRow = row;
clickBgColor = mouseOverBgColor;
}
function mouseOver(row, backColor)
{
if(previousRow == row)
return;
else
{
mouseOverBgColor = backColor;
document.getElementById(row).style.backgroundColor = "#EEFF00";
}
}
function mouseOut(row)
{
if(previousRow == row)
return;
else
document.getElementById(row).style.backgroundColor = mouseOverBgColor;
}
</pre>
and here is the code behind..
<pre>
protected void gdvToolSize_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "javascript:ChangeRowColor('" + e.Row.ClientID + "')");
e.Row.Attributes.Add("onmouseover", "javascript:mouseOver('" + e.Row.ClientID + "','" + e.Row.BackColor + "')");
e.Row.Attributes.Add("onmouseout", "javascript:mouseOut('" + e.Row.ClientID + "')");
}
}
</pre>
any help appreciated..
|
|
|
|
|
Can I fill a dropDownList Like treeView
thanks
ahmed eldeghedy
|
|
|
|
|
To make it look like a tree, with nodes, you'd need a custom control. I'm sure they exist, commercially. The easy way is to have a tree, and then show/hide it in a div when an arrow button is pressed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Then Why Dropdown List.
use Tree inside Div which can be expandable !!!
cheers,
Abhijit
|
|
|
|
|
I m fresher to asp.net now i m working on menu & Treeview can u send more information and sample code on it. and I m using vb code as background
Thanks
Ananda.
|
|
|
|
|
I would suggest that you start with something simpler. Why do you need to be working on menus and treeviews if you're new to ASP.NET ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I done rest of all other control that website pending in only Treeview...
|
|
|
|
|
|
Hi...
I have a browse button on client side webpage, now i need to select a application file on the server Machine by using the browse button...
Please help…
Thanks in advance
skvs
|
|
|
|
|
You plainly can't do that directly. ?You'll need to build UI to read the file system on the server and show it to the client.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello Guys...
I m created a asp.net web page and control also. now when i open the page it take's too time. I load Image like 2053*3420 size. now what i do for fast loading without removing images and size also....
Plz Help Me...
Thanks
Ananda.
|
|
|
|
|
The page will load before the images load. But the first time you run an ASP.NET page, it's compiling, which could be what makes it slow.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Reducing the actual size of the image would help, just create a version the size you want to display.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
i have a requirement to read a data from a file and load it in to the database. Before loading in to database directly. I am reading data to data table and processing the row by row and then loading in to the database.
If a file contains..5 million records, can datatable handle that one?
is there any limit for datatable?
G. Satish
|
|
|
|
|
Why don't you try it and see ? It sure sounds like a dumb move tho, what are you hoping to do with these 5 million records in memory that you can't do in the DB ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Actaullly, i didn;t find the direct method to load the csv file data to database. I find the method to load throught the datatable. But i know, it occupies more memory and the appliction will crash.
Is there any way to read the records from csv file and load it into sqlserver database?
G. Satish
|
|
|
|
|
Definately not all at once, do it in batches, reading from a stream.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
DTS/SSIS depending on your version of sqlserver, or bcp which works with all versions.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Satish - Developer wrote: Actaullly, i didn;t find the direct method to load the csv file data to database
There is SqlBulkCopy[^] class which is very useful to insert data into SQL server database. You can use OLEDB to read from the CSV and get a reader from it.
|
|
|
|
|
No Inherent restrictions on That .....but ur page becomes really heavy with so big DataTable
Use "Custom data providing" for manipulating large Datasets ...
see this link http://support.teamdev.com/thread/796[^]
|
|
|
|
|
i am using jquery in asp.net page .
jquery is working fine in page but when i fire a server side event on image button click after clicking on any jquery event
page produce error like
The state information is invalid for this page and might be corrupted.
please help me
thanks in advance
no knowledge in .net
|
|
|
|
|
|
Hi guys,
vs2005 having inbuilt iis?,
With out iis installation it will work?,
I know with out iis .net framework wont work,
But i have doubt on it vs 2005 having inbuit iis or not?
Plz clarify my doubt?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
It has a web server built in, but it's not IIS. It's fine for testing tho.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank u Graus
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|