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
190
How to use Eval("") in UltrawebGrid
posted

Hi ,

I am using infragistics grid and I wanted to know how I can use Eval in the Ultra web grid.

Thanks in advance

 

  • 28464
    Verified Answer
    posted

    Hello,

    Thanks for writing. Sure you can use Eval, you just need to make sure you are using templates (Templated Grid Column). Then, in the CellTemplate you can use Eval and map any data from the datasource to your HTML representation.

    Example:

       <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>