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

How to make particular Columns in RadGrid unclickable?

1 Answer 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 01 Feb 2013, 03:10 PM
Hello,

I want to allow the EnablePostBackOnRowClick only in some columns, is that possible?

Lets say I have a RadGrid with 5 Columns, is it possible to make only the 3 columns in the middle clickable and the first and last columsn not clickable?
I need this because I want to handle the "RowClick" event in ItemCommand but I don't want the RowCLick event to be triggered if I click on the row area of the first and last columns.

is it possible to do that?

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 06 Feb 2013, 01:17 PM
Hi Eric,

You can use the following approach:
<ClientEvents ... OnRowClick="rowClick" />
JavaScript:
function rowClick(sender, args) {
    var cell = args.get_domEvent().target;
    var column = args.get_tableView().get_columns()[cell.cellIndex];
 
    var condition = (column.get_uniqueName() != "ShipCountry");
    sender.ClientSettings.EnablePostBackOnRowClick = condition;
}

That should do the trick. Please give it a try and let me know about the result.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Eric
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or