This is a migrated thread and some comments may be shown as answers.

[Solved] Dbl click on radgrid

3 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 03 Sep 2009, 07:09 PM
Hi,

I'm having an usercontrol(.ascx) where I need to double click on a grid and it needs to open up another usercontrol.

I do the following: in .ascx

<

 

script type="text/javascript">

 

 

function RowDoubleClick(index)

 

{

__doPostBack(

"<%= this.UniqueID %>", "RowDblClicked:" + this.Rows[index].ItemIndex);

 

}
</script>
in client events I do,

 

 

<ClientEvents OnRowDblClick="RowDoubleClick"></ClientEvents>

 

 

 


and in ascx.cs file, I do this,

 

 

public partial class CPackageMainUserControl : BaseUserControl, IPostBackEventHandler
{

 

 

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)

 

{

 

string[] postBackEventArgumentData = eventArgument.Split(':');

 

 

switch (postBackEventArgumentData[0])

 

{

 

case "RowDblClicked":

 

m_ctlPackageGroupMultiView.SetActiveView(m_ctlPackageSetUpView);

m_ctlPackageSetupUserCtrl.LoadNonDocPredefinedReports();

 

break;

 

}

}
}

(because in my cause when i dbl click on a row in a radgrid , I need to setactiveview to openup another view).

But when i do all this and try to run , I get a javascript message :

Microsoft JScript runtime error: 'this.Rows' is null or not an object.

Pls help me and correct my code and let me know what to do .
Thanks,
ZR


3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Sep 2009, 09:40 AM
Hi Zaheka,

Are you using RadGrid for asp.net or RadGrid for asp.net AJAX version? I guess the above given code will work only with RadGrid for asp.net version. If you are using RadGrid for asp.net AJAX version try with the following approach and see whether it is working.

JS:
 
function RowDoubleClick(sender, eventArgs) 
 
  __doPostBack("<%= RadGrid1.UniqueID %>", "RowClicked:" + eventArgs.get_itemIndexHierarchical());       
 


Thanks
Shinu

0
Ayesha
Top achievements
Rank 1
answered on 07 Sep 2009, 07:48 PM
Hi Shinu,

I'm uisng the radgrid for asp.net and not the ajax version . pls do help me ?? what am i missing worng??
It gives me the messgae this.rows is undefined.
0
Shinu
Top achievements
Rank 2
answered on 08 Sep 2009, 06:32 AM
Hi Zaheka,

The code is working fine in my end. I am not sure about what is happening in your side. Can you try passing the ' index ' rather than ' this.Rows[index].ItemIndex ' to the postback method and see whether it is working fine?

Also checkout the following KB article:
Performing postback from grid client events

-Shinu.
Tags
Grid
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ayesha
Top achievements
Rank 1
Share this question
or