Basically, I am trying to have a checkbox on the Grid row that when checked doesn't fire a server-side or client-side event. When I click on a button on the page, I'd like to cycle through the grid and get the items with a checkmark.
Thanks!
3 Answers, 1 is accepted
The RowClick event is not fired when you click on a control within a table cell in the grid. Am I missing something. Could you paste your aspx and code behind?
Thanks.
Regards,Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Im having this same issue. Is there a solution for this? Basically I wan to disable the "rowclick" only for column on which contains a checkbox. I have delete button on the page that will operate on all check boxes....
<telerik:RadGrid ID="dgTransactions" runat="server" AllowPaging="True" AllowSorting="True" PageSize="200" Height="600px" AllowMultiRowSelection="true">
<GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
<SortingSettings EnableSkinSortStyles="False"></SortingSettings>
<ClientSettings EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Resizing AllowColumnResize="True" AllowResizeToFit="True" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" Width="100%" DataKeyNames="TransactionID" AllowSorting="True" AllowNaturalSort="False" >
<Columns>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
<HeaderStyle HorizontalAlign="Center" Width="20px" />
<ItemStyle HorizontalAlign="Right"/>
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn DataField="TransactionDate" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter DatePosted column" HeaderText="Entered" ItemStyle-HorizontalAlign="Right" ReadOnly="True" UniqueName="TransactionDate">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FollowUpDate" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter DatePosted column" HeaderText="Follow Up" ItemStyle-HorizontalAlign="Right" ReadOnly="True" UniqueName="FollowUpDate">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ChargeAmount" DataFormatString="{0:c}" FilterControlAltText="Filter Subject column" HeaderText="Charge" ReadOnly="True" UniqueName="ChargeAmount" ItemStyle-HorizontalAlign="Right">
<HeaderStyle Width="45px" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CreditAmount" DataFormatString="{0:c}" FilterControlAltText="Filter Subject column" HeaderText="Credit" ReadOnly="True" UniqueName="CreditAmount" ItemStyle-HorizontalAlign="Right">
<HeaderStyle Width="45px" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PostDate" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter DatePosted column" HeaderText="Post" ItemStyle-HorizontalAlign="Right" ReadOnly="True" UniqueName="PostDate">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Comment" FilterControlAltText="Filter Subject column" HeaderText="Comments" ReadOnly="True" UniqueName="Comment" AllowSorting="True" HtmlEncode="true">
<HeaderStyle Width="250px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UserInitials" FilterControlAltText="Filter Subject column" HeaderText="By" ReadOnly="True" UniqueName="UserInitials">
<HeaderStyle Width="35px" />
</telerik:GridBoundColumn>
</Columns>
<SortExpressions>
<telerik:GridSortExpression FieldName="TransactionDate" SortOrder="Descending" />
</SortExpressions>
<HeaderStyle Font-Bold="True" />
</MasterTableView>
</telerik:RadGrid>
You can check the content of the currently clicked cell in the OnRowSelecting event of the Grid and disable the click if the cell contains an input:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/events/onrowselecting
For example, you can have a similar logic:
function
onRowSelecting(sender, args) {
var
e = args.get_domEvent();
var
targetElement = e.srcElement || e.target || event.target;
var
input = targetElement.children[0];
if
(input && input.id.lastIndexOf(
"ClientSelectColumnSelectCheckBox"
) > 0) {
args.set_cancel(
true
);
}
}
Regards,
Vessy
Progress Telerik