views:

148

answers:

2

There's the usual Gridview with template column

<ItemTemplate>
    "lbOpen" Text='Select' runat="server" OnCommand="lbOpen_Command"
    CommandName="open" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "OrderID") %>'  />

Unexpectedly and by unknown reason "lbOpen_Command" ceased to fire. After stop at page OnInit() breakpoint at "lbOpen_Command" does not hit. There were no even a least changes to .aspx page and event execution chain.

What can be the reason? Any suggestions?

thanks in advance.

A: 

At what point in the page execution timeline are you binding data to the datagrid? Its possible that if you're doing so before the lbOpen_Command event would be fired that you're wiping the event out.

John Christensen
It might be a reason. Grid databinding is called implicitly (it uses LinqDataSource.OnSelecting events - BTW, I also have issues with them, the queries are time-consuming and fires several times within page lifecycle, I had to use the tricks to cut off redundant calls)Explicit .Databind() is not called in my case
igor
A: 

Solved by adding implicit gridview .Databind() command. Thanks to all.

igor