.net Radgrid with button in column only calls item command on 2nd click
I am having an issue where a button in a radius does not fire until the second time.
I have a usercontrol with a radgrid on it and a button inside one of its columns. The custom control is on the page.
When I press the button on the radio, nothing happens the first time, however it works the 2nd time.
This is some of the data of a radgorized column
<telerik:GridTemplateColumn DataField="Quantity" HeaderText="Quantity" UniqueName="QuantityCol">
<ItemTemplate>
<asp:TextBox ID="Quantity" runat="server" Columns="4" Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' width="40px" />
<asp:LinkButton id='btnUpdateRow' runat="server" CausesValidation="false" Text='<span>Update</span>' CommandName="ButtonUpdateRow" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'/>
</ItemTemplate>
</telerik:GridTemplateColumn>
Radgrid uses NeedDataSource to get its data. Loading the page does nothing.
While debugging in itemcreated / itemdatabound, the linkbutton client shows that
TestBasket_RadGrid1_ctl01_ctl04_btnUpdateRow
However, when displayed in a browser, it appears as
<a id="TestBasket_RadGrid1_ctl01_ctl09_btnUpdateRow" href="javascript:__doPostBack('TestBasket$RadGrid1$ctl01$ctl09$btnUpdateRow','')">
Button click - itemcommand is NOT triggered. Upon returning from postback, the browser shows
<a id="TestBasket_RadGrid1_ctl01_ctl04_btnUpdateRow" href="javascript:__doPostBack('TestBasket$RadGrid1$ctl01$ctl04$btnUpdateRow','')">
Clicking the button - itemcommand starts.
Does anyone explain why clientid is getting changes. I tried to place a placeholder and create a control with an id in itemcreated - still the same problem.
Thanks in advance for any help.
source to share
It looks like the problem was due to page inheritance. I made a simple aspx page that doesn't use any of our architectures and it seems to work fine. Then I bought the code and it stopped working. I was able to fix this by changing the page inheritance of pages that use Telerik controls.
source to share