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
The code looks like
<ClientSettings> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
or False if you don't want to enable selection, of course.
Good luck!
Brandon
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
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
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
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
Thanks to you and thanks to Vlad.
you are very helpful.
The problem is now solved.
Stanley
Once I select a row it gets selected till I select another row.
The ctrl key doesn't help.
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.
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>
Once I click the check box , the only way I can deselct is by selecting another row.
Am I doing something wrong?
http://www.telerik.com/community/forums/thread/b311D-behhak.aspx
The ctrl key didn't work for me but I found this more useful.
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.