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

Selecting Item inside Radgrid

6 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ghadeer
Top achievements
Rank 1
ghadeer asked on 23 Nov 2008, 05:54 AM
Hello All,
which event can I used to fire when I click item inside the grid?????????
 
thanks in advance
ghadeer

6 Answers, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 24 Nov 2008, 04:04 AM
Hi Ghadeer,

You can set the ClientSettings.Selecting.AllowRowSelection property to true in order to enable client-side selecting of RadGrid items with a mouse click. If you want to handle the client-side select event, set your RadGrid's ClientSettings.Events.OnRowSelecting property to the name of a method that will handle the event.

Take a look at this help topic which discusses how to enable client-side selecting with the click of a mouse, and this help topic which discusses how to handle the client-side OnRowSelecting event.

I hope that helps. Let me know if you have any further questions.

Sincerely,
Kevin Babcock
0
Princy
Top achievements
Rank 1
answered on 24 Nov 2008, 04:30 AM
Hello Ghadeer,

You can also use the SelectedIndexChanged event of the grid, for server-side selection of an item provided you set the ClientSettings.EnablePostBackOnRowClick property to true as shown below:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" OnSelectedIndexChanged="RadGrid2_SelectedIndexChanged" >           
  <MasterTableView> 
   ....         
  </MasterTableView>         
      <ClientSettings EnablePostBackOnRowClick="true" >   
        <Selecting AllowRowSelect="True" /> 
      </ClientSettings> 
</telerik:RadGrid> 

cs:
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
       
 
    } 

Thanks
Princy.
0
ghadeer
Top achievements
Rank 1
answered on 25 Nov 2008, 05:19 AM
Hello,
thanks.....
I used like this:

 

<script type="text/javascript" language="Javascript">

 

function

 

open_printDescform()

{

alert(

'hh');

 

 

}

 

 

</

script>

 

 


//////

<

ClientEvents OnColumnClick="open_printDescform()" />

 

 

 


but when I click on items inside grid at runtime I didnt get alert!!!!!!
thanks in advance
khalid

0
Princy
Top achievements
Rank 1
answered on 25 Nov 2008, 06:01 AM
Hello Khalid,

The OnColumnClick client event  will fire only when the column header is clicked but if you want to display an alert while clicking on the items(rows) in the grid, then you can use the OnRowClick client event.

Thanks
Princy.
0
ghadeer
Top achievements
Rank 1
answered on 25 Nov 2008, 06:19 AM
Hello there,

I tried still not working ....
the case I want when I click on items inside the grid , new webform opend.

is there other solution.

thanks in advance
ghadeer
0
Shinu
Top achievements
Rank 1
answered on 25 Nov 2008, 10:18 AM
Hello Ghadeer,

I tried implementing this scenario as shown in the code below and its working as expected. Check for any differences(if any) with your code.
<telerik:RadGrid ID="RadGrid2" runat="server" >            
   <MasterTableView> 
   </MasterTableView>          
   <ClientSettings>          
        <ClientEvents OnRowClick="RowClick" />                 
   </ClientSettings> 
</telerik:RadGrid> 

js:
function RowClick()  
 {  
   window.open("Default1.aspx");  
    
 } 

Thanks
Princy.
Tags
Grid
Asked by
ghadeer
Top achievements
Rank 1
Answers by
Kevin Babcock
Top achievements
Rank 1
Princy
Top achievements
Rank 1
ghadeer
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or