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

Capture rows clicked with GridBoundColumn

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RB
Top achievements
Rank 1
RB asked on 16 Jun 2014, 05:04 PM
I have a radgrid with a  GridBoundColumn. There is a button outside the radgrid with is enabled only when one or more rows are selected. How can I achieve this client side? I tried the following but did not work:
this._RadGrid1.ClientSettings.ClientEvents.OnRowSelected = "OnRowSelected";

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jun 2014, 03:10 AM
Hi,

Please make sure  you are setting the Selecting-AllowRowSelect property of RadGrid to true. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadGrid ID="rgrdOrders" runat="server" DataSourceID="SqlDataSource1" CellSpacing="-1"
    GridLines="Both">
    <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="OrderID">
        <Columns>
          ...
        </Columns>
    </MasterTableView>
    <ClientSettings Selecting-AllowRowSelect="true">
        <ClientEvents OnRowSelected="EnableButton" />
    </ClientSettings>
</telerik:RadGrid>
<telerik:RadButton ID="rbtnSubmit" runat="server" Text="Submit" Enabled="false">
</telerik:RadButton>

JavaScript:
function EnableButton(sender, args) {
    var button = $find("<%=rbtnSubmit.ClientID%>");
    button.set_enabled(true);
}

Thanks,
Shinu.
Tags
Grid
Asked by
RB
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or