Click here to Skip to main content
15,891,375 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: urgent Pin
raviraazk29-Apr-09 6:28
raviraazk29-Apr-09 6:28 
GeneralRe: urgent Pin
MidwestLimey29-Apr-09 7:02
professionalMidwestLimey29-Apr-09 7:02 
GeneralRe: urgent Pin
raviraazk29-Apr-09 7:34
raviraazk29-Apr-09 7:34 
AnswerRe: urgent Pin
Christian Graus29-Apr-09 8:24
protectorChristian Graus29-Apr-09 8:24 
AnswerRe: urgent Pin
saanj29-Apr-09 23:27
saanj29-Apr-09 23:27 
QuestionAjax AutocompleteExtender does not Work Pin
jai_10129-Apr-09 5:37
jai_10129-Apr-09 5:37 
AnswerRe: Ajax AutocompleteExtender does not Work Pin
Herman<T>.Instance29-Apr-09 11:15
Herman<T>.Instance29-Apr-09 11:15 
QuestionReturning the highlighted row Pin
dptalt29-Apr-09 4:49
dptalt29-Apr-09 4:49 
I found a simple example that allows the user to hightlight a row in a gridview.
The problem is how do I know which row is hightlighted. For example, how can I get the rowindex of the hightlighted row?

Below is the example code I am using from this url.

http://www.netomatix.com/development/gridviewrowselectedstyle.aspx



protected void OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "onGridViewRowSelected('" + m_iRowIdx.ToString() + "')");
}
m_iRowIdx++;
}



var gridViewCtlId = '&lt;%=ctlGridView.ClientID%&gt;';
var gridViewCtl = null;
var curSelRow = null;
function getGridViewControl()
{
if (null == gridViewCtl)
{
gridViewCtl = document.getElementById(gridViewCtlId);
}
}

function onGridViewRowSelected(rowIdx)
{
var selRow = getSelectedRow(rowIdx);
if (curSelRow != null)
{
curSelRow.style.backgroundColor = '#ffffff';
}

if (null != selRow)
{
curSelRow = selRow;
curSelRow.style.backgroundColor = '#ff0022';
}
}

function getSelectedRow(rowIdx)
{
getGridViewControl();
if (null != gridViewCtl)
{
return gridViewCtl.rows[rowIdx];
}
return null;
}

AnswerRe: Returning the highlighted row Pin
AlexeiXX329-Apr-09 6:35
AlexeiXX329-Apr-09 6:35 
GeneralRe: Returning the highlighted row Pin
dptalt29-Apr-09 6:56
dptalt29-Apr-09 6:56 
GeneralRe: Returning the highlighted row Pin
AlexeiXX329-Apr-09 6:59
AlexeiXX329-Apr-09 6:59 
QuestionLogin code Pin
Gjm29-Apr-09 3:29
Gjm29-Apr-09 3:29 
AnswerRe: Login code Pin
Abhijit Jana29-Apr-09 3:42
professionalAbhijit Jana29-Apr-09 3:42 
AnswerRe: Login code Pin
MidwestLimey29-Apr-09 5:35
professionalMidwestLimey29-Apr-09 5:35 
AnswerRe: Login code Pin
AlexeiXX329-Apr-09 6:39
AlexeiXX329-Apr-09 6:39 
QuestionGrid View Problem Pin
Amit Patel198529-Apr-09 3:20
Amit Patel198529-Apr-09 3:20 
QuestionAsp FileUpload Control Doesn't work with Ajax (C# help plz) Pin
Kazi Islam29-Apr-09 2:18
Kazi Islam29-Apr-09 2:18 
AnswerRe: Asp FileUpload Control Doesn't work with Ajax (C# help plz) Pin
dotnetmember29-Apr-09 18:40
dotnetmember29-Apr-09 18:40 
QuestionGrid View Problem Pin
Amit Patel198529-Apr-09 1:47
Amit Patel198529-Apr-09 1:47 
AnswerRe: Grid View Problem Pin
MidwestLimey29-Apr-09 5:31
professionalMidwestLimey29-Apr-09 5:31 
QuestionNot sending Email Pin
D.K.C29-Apr-09 1:29
D.K.C29-Apr-09 1:29 
AnswerRe: Not sending Email Pin
N a v a n e e t h29-Apr-09 2:29
N a v a n e e t h29-Apr-09 2:29 
GeneralRe: Not sending Email Pin
D.K.C1-May-09 2:27
D.K.C1-May-09 2:27 
AnswerRe: Not sending Email Pin
Goalie3529-Apr-09 8:54
Goalie3529-Apr-09 8:54 
QuestionProblems with SMTPMail attachments Pin
ddepauli29-Apr-09 1:19
ddepauli29-Apr-09 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.