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

Grid Postback only on master table rows

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 11 Nov 2010, 05:22 PM
Hello,

I have a master/detail table.  I want to enable postback on row click, but only for master table rows.  How can I make that happen?  I saw articles on using __doPostBack('<%= rg1.ClientID');, but I want it to fire the ItemCommand event.  Is there a way to wire that up to make it work on client row click?  Add a RowClick$<index> parameter, or something?

Or is there another setting?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Nov 2010, 11:54 AM
Hello Brian,

Try the following approach to achieve your requirement. Attach OnRowClick client event to RadGrid. Inside that event handler check for the GridTableView name and if it is masterTable, then  perform the postback request using __doPostBack("<%= RadGrid1.UniqueID %>". And process the postback in the code-behind of the page using the RaisePostBackEventHandler instead of ItemCommand event.

Java Script:
<script type="text/javascript">
    function RowClick(sender, args) {
          var dataItem = args.get_gridDataItem();
          if (dataItem.get_owner().get_name() == "Master"){ // check woth the name of GridTableView
        }
</script>

Please go through the following KB article for more information on performing postback from grid client events.

Performing postback from grid client events


Hope this helps,
Princy.
Tags
Grid
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or