Selecting Item inside Radgrid

7 posts, 0 answers
  1. ghadeer
    ghadeer avatar
    57 posts
    Member since:
    Mar 2008

    Posted 22 Nov 2008 Link to this post

    Hello All,
    which event can I used to fire when I click item inside the grid?????????
     
    thanks in advance
    ghadeer
  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 23 Nov 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Nov 2008 Link to this post

    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.
  5. ghadeer
    ghadeer avatar
    57 posts
    Member since:
    Mar 2008

    Posted 24 Nov 2008 Link to this post

    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

  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Nov 2008 Link to this post

    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.
  7. ghadeer
    ghadeer avatar
    57 posts
    Member since:
    Mar 2008

    Posted 25 Nov 2008 Link to this post

    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
  8. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Nov 2008 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017