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

Row select only by using GridClientSelectColumn

2 Answers 469 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas Derenthal
Top achievements
Rank 1
Thomas Derenthal asked on 02 Nov 2014, 02:53 PM
I do not want the row to be selected by clicking on it. I would like it to only be selected when the GridClientSelectColumn checkbox has been checked or unchecked. And is it possible to not highlight the row at all when it is selected?

<telerik:RadGrid ID="gridFundingBills" runat="server" Width="1100px" AllowMultiRowSelection="True"
                CssClass=" MyGridClass"
                AutoGenerateColumns="False"
                OnNeedDataSource="gridFundingBills_NeedDataSource"
                OnItemDataBound="gridFundingBills_ItemDataBound"
                 OnItemCreated="gridFundingBills_ItemCreated" >
                <MasterTableView DataKeyNames="FundingDtlID" EditMode="InPlace"
                    NoMasterRecordsText="There are no open funding bills at this time">
                    <Columns>
                        <telerik:GridBoundColumn DataField="CustomerNm" FilterControlAltText="Filter CustomerNm column" HeaderText="Property" SortExpression="CustomerNm" UniqueName="CustomerNm">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="VendorNm" FilterControlAltText="Filter VendorNm column" HeaderText="Vendor" SortExpression="VendorNm" UniqueName="VendorNm">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BankAcct" FilterControlAltText="Filter BankAcct column" HeaderText="Bank" ReadOnly="True" SortExpression="BankAcct" UniqueName="BankAcct">
                        </telerik:GridBoundColumn>
                        <telerik:GridHyperLinkColumn UniqueName="BillNo" HeaderText="Bill Reference Number" DataTextField="BillNo" DataNavigateUrlFields="BillUrl" DataNavigateUrlFormatString="http://{0}" Target="_blank">
                        </telerik:GridHyperLinkColumn>
                        <telerik:GridBoundColumn DataField="BillURL" FilterControlAltText="Filter BillURL column" ReadOnly="True" SortExpression="BillURL" UniqueName="BillURL" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BillPeriod" FilterControlAltText="Filter BillPeriod column" HeaderText="Bill Period" ReadOnly="True" SortExpression="BillPeriod" UniqueName="BillPeriod" ItemStyle-Width="150px" HeaderStyle-Width="150px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DueDt" DataType="System.DateTime" FilterControlAltText="Filter DueDt column" HeaderText="Due Date" SortExpression="DueDt" UniqueName="DueDt" DataFormatString="{0:d}" ItemStyle-Width="75px" HeaderStyle-Width="75px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="TotalAmt" DataType="System.Decimal" FilterControlAltText="Filter TotalAmt column" HeaderText="TotalAmt" SortExpression="Total Due" UniqueName="TotalAmt" DataFormatString="{0:F}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="75px" HeaderStyle-Width="75px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="RemainingAmt" DataType="System.Decimal" FilterControlAltText="Filter RemainingAmt column" HeaderText="Remaining Balance" ReadOnly="True" SortExpression="RemainingAmt" UniqueName="RemainingAmt" DataFormatString="{0:F}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="75px" HeaderStyle-Width="75px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FundingDtlID" DataType="System.Guid" FilterControlAltText="Filter FundingDtlID column" HeaderText="FundingDtlID" ReadOnly="True" SortExpression="FundingDtlID" UniqueName="FundingDtlID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SourceBankAcctID" DataType="System.Guid" FilterControlAltText="Filter BankAcctID column" HeaderText="BankAcctID" ReadOnly="True" SortExpression="BankAcctID" UniqueName="BankAcctID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Amount Approved" UniqueName="AmtApproved" HeaderStyle-Width="55px"
                            ItemStyle-Width="55px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:TextBox ID="AmountApproved" runat="server" Width="55px" OnTextChanged="AmountApproved_TextChanged"
                                    AutoPostBack="true" CssClass="numericAlign"></asp:TextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
                        </telerik:GridClientSelectColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                    <ClientEvents OnRowSelected="handleTextBoxValue" OnRowDeselected="handleTextBoxValue" OnActiveRowChanged="sumAmtApproved" />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
            </telerik:RadGrid>

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 03 Nov 2014, 10:17 AM
Hi,

To select the row only by using GridClientSelectColumn you should set UseClientSelectColumnOnly property to true:
<ClientSettings>
    <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
 </ClientSettings>

About your second question you can refer to the forum thread below:
http://www.telerik.com/forums/disable-highlight-row

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Thomas Derenthal
Top achievements
Rank 1
answered on 03 Nov 2014, 05:03 PM
Thank you. This works. 
Tags
Grid
Asked by
Thomas Derenthal
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Thomas Derenthal
Top achievements
Rank 1
Share this question
or