Frage

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();
War es hilfreich?

Lösung

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

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top