Get all checked values from GridClientSelectColumn

2 posts, 0 answers
  1. Vivek
    Vivek avatar
    1 posts
    Member since:
    Jul 2015

    Posted 30 Jul 2015 Link to this post


     I am trying to find the values of the checkbox which are checking on button click event but its not work.

    Please help me out on this.


    This is aspx file.

    <telerik:RadGrid ID="RadGridActivity" AutoGenerateColumns="False"  runat="server" AllowMultiRowSelection="True" FilterType="CheckList" GroupPanelPosition="Top"  >
            <ClientSettings Selecting-AllowRowSelect="true" >
               <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" />
                    <telerik:GridClientSelectColumn  UniqueName="SelectActivity" HeaderText="Select" ></telerik:GridClientSelectColumn> 
                    <telerik:GridBoundColumn UniqueName="ActivityId" HeaderText="ActivityId" DataField="intActivityId" FilterDelay="200" ></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="ActivityName" HeaderText="Activity" DataField="strActivityName" AllowFiltering="true" ></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Company" HeaderText="Company" DataField="strCompany" AllowFiltering="true"></telerik:GridBoundColumn>
            <ClientSettings EnableRowHoverStyle="true" >

                <Selecting AllowRowSelect="True"></Selecting>
        <telerik:RadButton ID="btnAdd" runat="server" Text="Add"></telerik:RadButton>


    Code behind


    Protected Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click

            For Each item As GridDataItem In RadGridActivity.SelectedItems
                Dim id As String
                Dim chec As Boolean

                Dim chk As CheckBox = DirectCast(item("SelectActivity").Controls(0), CheckBox)
                id = item("ActivityId").Text
                chec = chk.Checked


        End Sub


  2. Eyup
    Eyup avatar
    3690 posts

    Posted 04 Aug 2015 Link to this post

    Hi Vivek,

    You are in the right direction. You can traverse the SelectedItems collection provided by the grid and extract the item values:

    Let me know if this works for you.

    For more advanced scenario, I suggest that you examine the sample provided in the following post:

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top