hi to All!.
am having a gridview with large no of rows,so i added the gridview in to the panel, now i want to show the number of records, like
while you MouseOver on the Row , i have to display the message like CurrentRecordNo/TotalRecordNo.
if you move the cursor/mouse to the next row of the gridview then it should change NextRecordNo/TotalRecordNo.
could anyone tell/suggest me on this,this is for web appln in C#,VS2005.
cOuld any one help me how to make the Headers of Gridview as Fixed,the datarows are being scrollable,as am adding the gridview in to the panel.
|
| Author: Sidewinder2 26 Sep 2008 | Member Level: Gold | Rating:  Points: 6 |
hi,
to get the current row number
protected void Grid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))) {
e.Item.Cells[1].Attributes.Add("style", "cursor:hand"); e.Item.Cells[1].Attributes.Add("onClick", "return show(this,'" + Grid.ClientID + "');"); } }
show(obj,dg1) {
var DG1 = document.getElementById(dg);
if(obj!=null) { var par=obj.parentNode;
while(par.nodeName.toLowerCase()!='tr') { par=par.parentNode; } var param = par.rowIndex;
var len = DG1.Rows.length; alert("Current Record Number is "+param+"/ Total Record number is "+len);
return true; }
return false;
}
}
from this code u will only get the message when u click on 2nd column in the datagird. so make the code as per ur requirement.
cheers!, Myself
|
| Author: jayakumar 27 Sep 2008 | Member Level: Gold | Rating:  Points: 1 |
thanks for ur response,i ll try and let you know if i face any doubt
|