Pregunta

I have listview and String array datasource. How can I bind them using eval ?

 <telerik:RadListView ID="lvDevSampTableSelection" runat="server" AllowMultiItemSelection="true">

    <ItemTemplate>
              <p><%# Eval("??") %></p>
    </ItemTemplate>

  </telerik:RadListView>

here is code behind

            ResultDto<String[]> result = client.GetTableNames("IMAPPUSER");

            var source = new BindingSource();
            source.DataSource = result.Data;

            lvDevSampTableSelection.DataSource = source;
            lvDevSampTableSelection.DataBind();
¿Fue útil?

Solución

I use <%# Container.DataItem %> instead of eval and get data from string to listview

Otros consejos

You can't, it needs to evaluate field names from the object that is the datasource (be it columns in datatable or fields in some List). Thus, I think your best option is to create a custom class with a couple of fields, create a List<> from that class and bind to that list.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top