RadGrid how to disable Row Click in some Cells? asp.net - telerik

This question might be a bit specific since it invovles a specific type of grid called RadGrid from Telerik.
I have a RadGrid with 5 columns with the EnablePostBackOnRowClick set to true, but I only want the RowClick event to be executed on 3 grid cells, I don't want this event to be executed on the fisrt and last cell (column), is there anyway to disable the RowClick event from being triggered when you click on these particular cells? Is there a way to limit the RowClick event to just the 3 cells/columns in the middle?

Take a look at this Telerik demo: Grid Cell Selection
If you specify an OnCellSelected client method, you could check which column the cell belongs to, then send an AJAX request back to the server (if if it's one of your 3 columns) and put your remaining logic in the server-side AJAX request handler method. I'm not sure if the server-side ItemCommand method can detect which cell you clicked on, but try that first, and if it doesn't work then the AJAX route would suffice. Also, you need at least the 2012 build of RadControls.
This is the markup for setting the appropriate settings:
<ClientSettings>
<ClientEvents OnCellSelected="cellSelected"></ClientEvents>
<Selecting CellSelectionMode="SingleColumn"></Selecting>
</ClientSettings>

Related

ClientSide RowSelect stops working after pagesize change in radgrid

I have many telerik rad grids in my project .
It initialize with ability to have client side row selection with
<clientsettings>
<Selecting AllowRowSelect="True" />
</clientsettings>
it is ok and in first load when my paging selector is on 10 object per grid selecting works fine , but when I change page size to 20 or 50 selecting suddenly stops working and I can not select row as before . Can anyone help me with this ?
RadGrid loses its current selection on postback - e.g. when the data is sorted, a new
group or filter is added, or when the current page changes.
You can try following approaches to implement a way to persist the client-side selection. (sample code snippet is in the attached link)
Using Web Storage
Using JavaScript array
The following logic is used to persist the selected rows:
Handle OnRowSelected and OnRowDeselected events for RadGrid. In the handlers you should update the collection of the selected items.
Handle OnRowCreated event. In this handler you should check if the current item is present in the selected rows collection and select
it if necessary.
For full details, please check this article - Persisting the Selected Rows Client-side on Sorting/Paging/Filtering/Grouping

Filter every character in Kendo Grid

How do you force a Kendo grid to filter data after every character is typed, as in after every letter, not just when I press enter button?
I noticed that Kendo sends requests after every character typed, but without page size, and this request is used for autocomplete. I want to change that to bind this data not to autocomplete, but to the main grid instead.
I am using built in filters, one for each column.
Sorry for later response, I didn't have much time. Anyway as I mentioned in comment, this functionallity is not supported by Telerik. So you have to create everything by yourself.
In following example I have used filterMenuInit event which is fired after you click on filter icon (and only once!). In that event I have modified filter elements to add custom classes and ids. Then in jQuery I am catching keyUp events and adding items into filter.
Here is small example. I have implemented only equals filter, so you will have to do some modifications. But I hope it can help you in next work.

ExtJs - Triggering Column Header Sorting programmatically (e.g. with QTP)

Our team is setting up test scripts for automating interaction testing using QTP, for an ExtJS based application.
Many of our elements/objects are being detected as desired, with the exception of column header sorting triggers.
Our grid panel has remote sorting, however programatically triggering a column header "click" doesn't fire our sorting, although "click"ing manually on the column header does. I've tried mousedown and mouseup, on the column header Div, and it's children -titleEl and -textEl as well.
Any ideas?
Thanks in advance.
The simplest way would be to tell QTP to generate mouse events, this way all the events that are fired when a real human clicks the header will be fired when QTP clicks it.
As seen here
origReplayType = Setting.WebPackage("ReplayType")
Setting.WebPackage("ReplayType") = 2
Browser("B").Page("P").WebElement("column header").Click ' your script line here
Setting.WebPackage("ReplayType") = origReplayType
If this is a common occurrence you can use RegisterUserFunc to define a new DeviceClick function to your test objects.
A slightly more complex way is to debug the application and see which event triggers sorting the column and then use FireEvent with the correct event.

Jqgrid Edit Form Change Event of Select doesnt fire when scrolling thorugh records

I have been following this example, http://www.ok-soft-gmbh.com/jqGrid/DependendSelects2.htm, as it is just what I need. I have got it working but it doesnt work when scrolling through records. If you bring up the form and scroll from a UK record to a US record, the list doesnt change. The onChange event only fires when the user selects from the select drop down.
Is there a way around this?
Thanks for your help.
James
My old demo uses 'change' event handler defined in the dataEvents property of the editoptions. In the dataEvents array one can define other event handlers.
You need just bind keyup to the column exactly like it's described in the answer. In the body of the event handler you can do the same actions as in the body of the 'change' event handler (you can place the code in a function and call it from the both handlers). In the way you should be able to solve the problem.
UPDATED: I updated the old answer and another one which was origin for the demo which you used. The new demo support the navigation buttons (the buttons to edit the 'next' or the 'previous' row) in the editing form.

RadCombobox doesnot maintain selected item

I have binded RadCombo on LoadonDemand Event. when i change page of radgrid, RadCombo looses its selected item.
How to maintain RadCombo selected item.
Please Help
Have you tried using the RadComboBox's trackChanges() and commitChanges() methods to preserve the selected item across post-backs?
http://www.telerik.com/help/aspnet-ajax/combobox-client-side-radcombobox.html
I'm assuming the RadGrid is not contained in a RadAjaxPanel because if it were this would be taken care of automatically through partial page rendering (i.e. only the RadGrid would be re-rendered when paging occurs). It would probably be helpful if you could post you page's markup.
When you page the grid is rebound and the controls inside it are recreated. To keep the combobox selection, save it Cache of Session object and then recover it from there wiring the PageIndexChanged event of the grid.

Categories

Resources