New Posts New Posts RSS Feed: GridViewContext.RowDoubleClickCommandName
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

GridViewContext.RowDoubleClickCommandName

 Post Reply Post Reply
Author
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Topic: GridViewContext.RowDoubleClickCommandName
    Posted: 20-Dec-2007 at 12:52pm
On the handler method for the command, where I showed it in my example.
 
Bill
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 18-Dec-2007 at 8:45am
Is there a specific place this should go?
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 14-Dec-2007 at 4:37pm
I missed an important point. 
 
CAB provides a declarative syntax for specifying a command handler:

[CommandHandler(commandName)]

void
cmd_ExecuteAction(object sender, EventArgs e)

{

// Perform edit processing here

}

That way you don't have to fish the command out of the WorkItem and attach the handler yourself.

Sorry,
Bill J.
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 13-Nov-2007 at 3:19pm
Hi Dan,
You'll need a unique command name, so the second form:
 
searchResultsViewContext.RowDoubleClickCommandName =searchResultsViewContext.MakeViewSpecifiedId(CommandNames.Edit);
 
is what you want.
 
The next question is "What do you want to happen when the command is fired?"  You'll need to attach a handler to the command like this:

string commandName = viewContext.MakeViewSpecificId(CommandNames.Edit);

Command cmd = WorkItem.Commands.Get(commandName);

// Attach command handler

cmd.ExecuteAction += new EventHandler(cmd_ExecuteAction);
----------------------------------
 
void cmd_ExecuteAction(object sender, EventArgs e)

{

// Perform edit processing here

}

Bill J.

Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 13-Nov-2007 at 2:32pm
I am trying to get the double click feature to work on a grid.
In the page controller where I set the ViewContext for the grid I have set the RowDoubleClickCommandName of the GridContext to EditNames.Edit. Hoping that it will run the edit command for that Grid but it doesn't. What am I doing wrong?
 
Code Excerpt (From SearchSummaryDetailPageController)
 

private void AddSearchResultsViewContext()

{

      // Create and add a new GridViewContext for the master grid

      GridViewContext searchResultsViewContext =

                            GridViewContext.AddNew(WorkItem, SearcherViewController.SearchResultsViewId);

 

      searchResultsViewContext.BeforeLeaveRowHandler = MasterGridBeforeLeaveRowHandler;

 

      searchResultsViewContext.RowDoubleClickCommandName =

CommandNames.Edit;
      //Have also tried
      //searchResultsViewContext.RowDoubleClickCommandName =searchResultsViewContext.MakeViewSpecifiedId(CommandNames.Edit);

}
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down