This is a migrated thread and some comments may be shown as answers.

LinkButton inside RadGrid

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Autessa
Top achievements
Rank 1
Autessa asked on 10 Mar 2009, 07:51 AM
I have a PagerTemplate in my RadGrid. Inside is a LinkButton that is used to trigger the grid's ItemCommand event when the value of the dropdown containing the pages changes.

<

 

PagerTemplate>
<table border="0" cellpadding="2" cellspacing="0" style="height: 20px" align="right">
<tr>
<td valign="baseline">
<%# ((int)DataBinder.Eval(Container, "OwnerTableView.CurrentPageIndex")+ 1) * (int)DataBinder.Eval(Container, "Paging.PageSize") - 4%> 

 

 

-

<%

# ((int)DataBinder.Eval(Container, "OwnerTableView.CurrentPageIndex") + 1) * (int)DataBinder.Eval(Container, "Paging.PageSize") - 5 + (int)DataBinder.Eval(Container, "Paging.Count")%>  of

 

<%

# DataBinder.Eval(Container, "Paging.DataSourceCount")%>
|
<asp:LinkButton CssClass="pagination" ID="lbPrev" Enabled='<%# (int)DataBinder.Eval(Container, "OwnerTableView.CurrentPageIndex") !=0 %>' CommandName="Page" CausesValidation="false" CommandArgument="Prev" runat="server">  
<%=Resources.Resource.strPrev_Paging%></asp:LinkButton>

|

</td>

 

<td valign="baseline">
<%=Resources.Resource.strPage%><asp:DropDownList ID="tbPageNumber" CssClass="forminputcomboPagination" runat="server" onchange="javascript:this.disabled = true;this.nextSibling.click();" />

 

 

<asp:LinkButton CssClass="pagination" ID="LinkButton4" runat="server" CommandName="CustomChangePage"></asp:LinkButton>
</td>
<td valign="baseline"> 
|
<asp:LinkButton CssClass="pagination" ID="lbNext" Enabled='<%# (int)DataBinder.Eval(Container, "OwnerTableView.CurrentPageIndex") != (int)DataBinder.Eval(Container, "Paging.PageCount")-1 %>' CommandName="Page" CausesValidation="false" CommandArgument="Next" runat="server">
<%=Resources.Resource.strNext_Paging%></asp:LinkButton> 

 

 

</td>
</tr>
</table></PagerTemplate>

 

 

 

 

It worked fine until recently when I encountered an "Object doesn't support this property or method." error message when I select from the dropdown. In View Source, the entire grid is not visible. I tried using Style["Display"] instead of the Visible property but I still encounter the same error.

What can I do?

1 Answer, 1 is accepted

Sort by
0
Autessa
Top achievements
Rank 1
answered on 10 Mar 2009, 08:15 AM
Found it :(

The LinkButton should be immediately after the dropdown. I may have pressed Ctrl+KD modifying the layout of my page. I dunno why this is such a big deal to JavaScript :( There are no other controls between the linkbutton and the dropdown but when the linkbutton is placed on a newline, the error appears.
Tags
Grid
Asked by
Autessa
Top achievements
Rank 1
Answers by
Autessa
Top achievements
Rank 1
Share this question
or