on 04-13-2008 2:06 PM
Hi,
I'm trying to bind PDK table control to a datatable object, where the result is read from connector:
DataTable dt =
getFirstTenRecordsFromEkko();
// from backend system
// table is SAP.Web.UI.Controls.Table
table.DataSource = dt;
table.AutoGenerateColumns = true;
table.DataBind(); // This displays nothing
// however, binding to gridview works
// gv is a gridview
gv.DataSource = dt;
gv.DataBind();
I'm using PDK for .NET v 2.5.
Please advise what I'm missing and thanks in advance,
Ali.
Hi Ali,
From SAP Table Datasource property reference [documentation|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/developercontent/sap%20portal%20development%20kit%20for%20.net%20developer's%20Guide/SAP.WebSAP.Web.UI.Controls.TableDataSource.html] follows that SAP Table Datasource object should implement IEnumerable interface.
From DataTable class [documentation|http://msdn2.microsoft.com/en-us/library/system.data.datatable.aspx] follows that DataTable class doesn't implement IEnumerable interface.
I believe that this mismatch causes a problem that you experience in SAP Table databinding.
I think that you can use [BindingList<>|http://msdn2.microsoft.com/en-us/library/ms132679.aspx] generic class for databinding. For example, if you want to display flights list in SAP Table, define Flight class for flight details and databind to SAP Table object of type BindingList<Flight>.
Regards,
Rima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.