Hi, I am using a customised uni selector, in which i want to add up and down arrows to order as in we are having option in custom table data, i have added the following xml code and linked to unigrid.
<?xml version="1.0" encoding="utf-8" ?> < grid > < actions > < action name="delete" commandargument="NodeID" caption="$General.Delete$" fonticonclass="icon-bin" fonticonstyle="critical" confirmation="$general.confirmdelete$"/> < action name="moveup" commandargument="NodeID" externalsourcename="moveup" caption="$General.Up$" fonticonclass="icon-chevron-up" /> < action name="movedown" commandargument="NodeID" externalsourcename="movedown" caption="$General.Down$" fonticonclass="icon-chevron-down" /> </ actions> <columns> < column source="DocumentName" sort="DocumentName" caption="$general.documentname$" wrap="false" cssclass="main-column-100" /> </ columns> < options> <key name="ShowSelection" value="true" /> <key name="DisplayFilter" value="true" /> </ options> </ grid>
now i am trying to create an onaction method as uniGrid.OnAction += uniGrid_OnAction; but this method is not firing at all? In this method i am using item.Generalized.MoveObjectUp(); and item.Generalized.MoveObjectDown();
uniGrid.OnAction += uniGrid_OnAction;
item.Generalized.MoveObjectUp(); and item.Generalized.MoveObjectDown();
what is the problem can you help me out.
Is your onaction method implemented like this? Also, where in the page lifecycle are you hooking the event up?
protected void cmsGrid_OnAction(string actionName, object actionArgument) { switch (actionName.ToLower()) { case "delete": //do action } }
Yes it is implemented as you mentioned and it is in "page load"
protected override void OnLoad(EventArgs e) { uniGrid.OnAction += uniGrid_OnAction; }
it is "onload" as mentioned in code by mistake i have written as "Page load"
Does your custom table have an order field that was defined through kentico? aka: itemorder, or something of that sort?
yes it has
Please, sign in to be able to submit a new answer.