Uni Selector order option

Sultan Ahmed asked on April 8, 2015 18:07

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();

what is the problem can you help me out.

Recent Answers


Joshua Adams answered on April 8, 2015 21:00

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
         }
    }
0 votesVote for this answer Mark as a Correct answer

Sultan Ahmed answered on April 9, 2015 06:51

Yes it is implemented as you mentioned and it is in "page load"

protected override void OnLoad(EventArgs e)
{
    uniGrid.OnAction += uniGrid_OnAction;
}
0 votesVote for this answer Mark as a Correct answer

Sultan Ahmed answered on April 9, 2015 06:58

it is "onload" as mentioned in code by mistake i have written as "Page load"

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on April 9, 2015 15:11

Does your custom table have an order field that was defined through kentico? aka: itemorder, or something of that sort?

0 votesVote for this answer Mark as a Correct answer

Sultan Ahmed answered on April 9, 2015 15:33

yes it has

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.