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

hide the GridClientSelectColumn, but still can select and unselect

13 Answers 346 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Esperanza Ramos
Top achievements
Rank 1
Esperanza Ramos asked on 18 Apr 2008, 02:46 PM
Hi, All:

I have a question.  I wish to hide the checkbox for the GridClientSelectColumn, but still I can select and un-select a row in RadGrid.

Please give some details.  Thanks.

here is my code:

<rad:GridClientSelectColumn Text="Select" Display="false"></rad:GridClientSelectColumn>


Stanley Huang

13 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 18 Apr 2008, 02:52 PM
I'm not sure if you want to enable or disable row selection... Give the "Enable Clientside Rows Selction" under the Rad Grid Tasks on the design surface a go. Set it to whatever you want to happen. Hope I understood that question correctly.

The code looks like

            <ClientSettings> 
           <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 

or False if you don't want to enable selection, of course.

Good luck!
Brandon
0
Esperanza Ramos
Top achievements
Rank 1
answered on 18 Apr 2008, 05:12 PM
Hi,

I think you did not understand my question.

My question is:  by putting this line:

<rad:GridClientSelectColumn Text="Select" Display="true"></rad:GridClientSelectColumn>

I will have one column displaying checkboxs for "Select".  (here users can select and un-select using the CheckBox)

However, I do not want this extra column which displays CheckBoxs.  And
I do want users to be able to select and un-select a row in the RadGrid.

Please help.

Stanley

0
Vlad
Telerik team
answered on 21 Apr 2008, 06:01 AM
Hello Stanley,

You can check the first grid in this example where you can select rows without checkbox:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/Selecting/DefaultCS.aspx

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Esperanza Ramos
Top achievements
Rank 1
answered on 21 Apr 2008, 01:21 PM
Hi, All:

Thanks, I saw the demo.  One can select and un-select by just clicking on the row in a grid.  However, now I can only select a row by clicking on the row. And I can not un-select it by clicking on the row.

I have this:
<ClientSettings AllowDragToGroup="false">
<Selecting AllowRowSelect="true" />
</ClientSettings>

and I removed this:
<rad:GridClientSelectColumn Text="Select" Display="false"></rad:GridClientSelectColumn>

Please give some details on how to implement:  un-select a row by simply clicking on the row (NOT by clicking on the "select" check box, because
I want to hide that check box.)

Thanks.

Stanley

0
Vlad
Telerik team
answered on 21 Apr 2008, 01:44 PM
Hello Stanley,

You can unselect the row if you hold Ctrl key and click similar to Window Explorer.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Esperanza Ramos
Top achievements
Rank 1
answered on 21 Apr 2008, 02:39 PM
Telerik Team:

Thanks to you and thanks to Vlad.

you are very helpful.

The problem is now solved.

Stanley
0
newbie
Top achievements
Rank 1
answered on 11 Aug 2008, 11:35 PM
Hi, I am unable to unselect the row even with the Ctrl key.
Once I select a row it gets selected till I select another row.

The ctrl key doesn't help.
0
Yavor
Telerik team
answered on 12 Aug 2008, 04:56 AM
Hi,

You can test the behavior under discussion in the following demo.
I hope this helps.

Kind regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
newbie
Top achievements
Rank 1
answered on 12 Aug 2008, 04:07 PM
it works fine in the demo but does not work in my app.

below is my grid declaration

<

telerik:RadGrid ID="grdTimesheets" runat="server" OnItemCommand="grdTimesheets_ItemCommand" OnDeleteCommand="grdTimesheets_DeleteCommand" OnNeedDataSource="grdTimesheets_NeedDataSource" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="20" AutoGenerateColumns="False" EnableLinqExpressions="false" OnPreRender="grdTimesheets_PreRender" OnItemCreated="grdTimesheets_ItemCreated" OnInit="grdTimesheets_Init" ImagesPath="../RadControls/UTC/Grid" EnableEmbeddedSkins="false" Skin="UTC" Width="1100px">

<ClientSettings>

<Selecting AllowRowSelect="true" />

</ClientSettings>

<ExportSettings>

<Pdf PaperSize="Letter" FontType="Subset"></Pdf>

<Excel Format="Html"></Excel>

</ExportSettings>

<PagerStyle Mode="NextPrevAndNumeric" />

<MasterTableView CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" Frame="Border" TableLayout="Auto" CommandItemDisplay="Bottom" DataKeyNames="TimesheetID" Width="1100px">

<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False">

</RowIndicatorColumn>

<Columns>

<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../RadControls/UTC/Grid/btnNewEdit.gif" CommandArgument="Edit" ItemStyle-HorizontalAlign="Center" CommandName="Edit" ItemStyle-Width="25px" Text="Edit" UniqueName="btnEdit">

</telerik:GridButtonColumn>

<telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="30px" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" ItemStyle-VerticalAlign="top" Visible="false">
<ItemTemplate>

<asp:ImageButton ID="btnCopyTimeSheet" runat="server" ImageUrl="../RadControls/UTC/Grid/btnNewEdit.gif" Text="Copy" BorderStyle="None" OnClientClick="ShowCopyDialogPopup(); return false;" ImageAlign="Left" /></ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn SortExpression="PayPeriod" HeaderText="Pay Period" DataField="PayPeriod"

UniqueName="PayPeriod" ItemStyle-Width="65px" CurrentFilterFunction="NoFilter"

FilterListOptions="VaryByDataType">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" DataField="ID" UniqueName="ID" ItemStyle-Width="20px" CurrentFilterFunction="NoFilter" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="DisplayName" HeaderText="DisplayName" DataField="DisplayName" UniqueName="DisplayName" ItemStyle-Width="100px" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" DataField="Status" UniqueName="Status" CurrentFilterFunction="NoFilter" ItemStyle-Width="60px" FilterListOptions="VaryByDataType">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="LastUpdatedBy" HeaderText="Updated By" DataField="LastUpdatedBy" UniqueName="LastUpdatedBy" ItemStyle-Width="100px" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="true">
</telerik:GridBoundColumn>

<telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Delete this timesheet?" ItemStyle-Width="25px" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">

<ItemStyle HorizontalAlign="Center" />

</telerik:GridButtonColumn>

</Columns>

<AlternatingItemStyle BackColor="#E0E0E0" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" />

<CommandItemStyle HorizontalAlign="Right" />

<CommandItemTemplate>

<asp:ImageButton ID="btnAdd" runat="server" ImageUrl="../App_Themes/MasterPage/btnAddNew.gif"Text="Add New" BorderStyle="None" BackColor="#707070" CommandName="InitInsert" ToolTip="Add" CommandArgument="InitInsert" />

<asp:ImageButton ID="btnCopy" runat="server" ImageUrl=""OnClientClick="if(!CheckForSelectedRows()) return false;" Text="Copy" ToolTip="Copy" BorderStyle="None" BackColor="#707070" CommandName="Copy" CommandArgument="InitInsert" />

</CommandItemTemplate>

</MasterTableView>

</telerik:RadGrid>

0
newbie
Top achievements
Rank 1
answered on 12 Aug 2008, 05:02 PM
I also tried it with a GridClientSelectColumn.

Once I click the check box , the only way I can deselct is by selecting another row.
Am I doing something wrong?
0
Adam Cole
Top achievements
Rank 1
answered on 26 Aug 2008, 04:18 PM
I am having the same problem.  Have you guys found a solution?
0
newbie
Top achievements
Rank 1
answered on 26 Aug 2008, 04:23 PM
go through this forum posting:

http://www.telerik.com/community/forums/thread/b311D-behhak.aspx

The ctrl key didn't work for me but I found this more useful.

0
Princy
Top achievements
Rank 2
answered on 27 Aug 2008, 10:51 AM
Hi Newbie,

You can try the following code snippet to deselect a row using CTRL key.

ASPX:
<ClientSettings> 
  <ClientEvents  OnRowSelecting="OnRowSelecting"   /> 
   <Selecting AllowRowSelect="true"  /> 
 </ClientSettings> 

JS:
 <script type="text/javascript" language="javascript" > 
         
       function OnRowSelecting(sender, args) 
        { 
            if (args.get_domEvent().ctrlKey) 
            { 
                args.set_cancel(true); 
            } 
        } 
    </script> 


Regards
Princy.
Tags
Grid
Asked by
Esperanza Ramos
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Esperanza Ramos
Top achievements
Rank 1
Vlad
Telerik team
newbie
Top achievements
Rank 1
Yavor
Telerik team
Adam Cole
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or