How does one enable/disable sorting of columns on client the client?
When a Row Edit Template is opening I want to disable grid behaviors so that features such as sorting cannot be performed while editing a row. Conversely when the Row Edit Template is closed I want to enable sorting (but only for those columns that were originally sortable). I could not find anything obvious in the sorting behavior collection.
Hello.
Thank you for contacting us.
About your concerns, when the template is opened you wont be able to apply sorting to any of the columns, this behavior is by design provided by our WebDataGrid. Could you please let me know if you are facing behavior other than mentioned above?
Looking forward to hearing from you.
Thanks Zdravka, indeed the sorting is not applied as you stated. I misunderstood a colleague.
The problem is when the row edit template is open and a cell within the grid is clicked the RET is closed. The grid has Activation and Selection behaviors. If the Activation behavior is removed the RET will remain open when another cells is clicked.
Can the Activation behavior be added and removed on the client?
Hello Madvelo.
I wanted to let you know that our behaviors cannot be enabled/disabled client-side, this is by design, you can although add/remove them server-side. And yes RET is hiding because of the activation behavior. Could I ask you for what you are using it, because I can be able to suggest you a better approach without using the activation?
My goal that is when the RET is opened, the only interaction the user has with the page is within the RET. So within the RET TemplateOpened event handler I am disabling any page controls such as buttons, links, textboxes, etc. I also want to have all interactions with the grid disabled as well. With respect to the Activation behavior, I simply removed that behavior from the grid's markup.
I think I'm close to achieving what I want with the exception of disabling an unboundCheckBoxfield column and canceling the edit when double clicking a row (I specified Mouseclick="Double" within the EditModeActions tag). Is there a way to detect if the RET is already opened (I suppose I could always create a variable to track the open/close status of the RET)?
Any suggestions are welcomed.
Hello Madvelo,
Thank you for the understanding and for the detailed explanation.
Yes you can create a variable that can track the state of RET or you can use jQuery selector and is method to check if RET is visible (opened) or not (closed).
Example:
$("#WebDataGrid1_ret").is(":visible")
This will return you true if RET is visible. As you can see RET id is combination of WebDataGrid ID and _ret.