Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Paging and templated column
posted

 I've turned on paging in my WebGrid.  I've got a templated column in my grid that is used to display a hyperlink.  When move to the next page, I get the following error:

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

 

HTML:
                    <igtbl:TemplatedColumn BaseColumnName="ID" Key="ID">
                        <Header Caption="ID">
                        </Header>
                        <CellTemplate>
                            <a href="WorkOrder.aspx?WorkOrderID=<%# Eval("ID") %>"><%# Eval("ID") %></a>
                        </CellTemplate>
                    </igtbl:TemplatedColumn>

How would one have a template column and paging work at the same time?

 

Rick 

Parents
  • 209
    posted

    I have general problem with the TemplatedColumns.

    Here is my markup for UltraWebGrid, I want to bind the value for the Name key into a Label and it doesn't work, it doesn't display anything.

         <ig:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="xmlDSAnimals" Height="200px" Width="325px">
             <Bands>
                 <ig:UltraGridBand AddButtonCaption="Animal" BaseTableName="Animal" Key="Animal">
                     <Columns>
                         <ig:TemplatedColumn IsBound="True" BaseColumnName="Name" Key="Name">
                             <Header Caption="Name" />
                             <CellTemplate>                            
                                 <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name", "Your name: {0}") %>'></asp:Label>
                             </CellTemplate>
                         </ig:TemplatedColumn>
                     </Columns>
                 </ig:UltraGridBand>
             </Bands>
         </ig:UltraWebGrid>

Reply Children