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

[Solved] Get Grid Caption on Client-Side

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Henrique Duarte
Top achievements
Rank 1
Veteran
Henrique Duarte asked on 25 May 2008, 04:18 PM
How can I get the grid caption on client event like RowClick?

[]'s!

Henrique

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 May 2008, 06:23 AM
Hi,

Try the following code snippet to achieve the desired scenario.

CS:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            string caption = RadGrid1.MasterTableView.Caption; 
            GridDataItem item = (GridDataItem)e.Item; 
            item.Attributes.Add("OnClick", "Show('" + caption + "');"); 
        } 
    } 


JS:
 <script type="text/javascript" language="javascript"
     function Show(caption) 
     { 
      alert(caption) 
     } 
   
     </script> 


Thanks
Shinu.
Tags
Grid
Asked by
Henrique Duarte
Top achievements
Rank 1
Veteran
Answers by
Shinu
Top achievements
Rank 2
Share this question
or