on 2007 Dec 26 4:10 AM
Hello experts,
I'm trying to develop one equivalent to Datagrid. For design purpose i want to add a table inside SAP table. SAP table allows only few instances to be applied to its cells. Jus like adding inputfield or a TextView i require a table to be added. Is it possible? I tried adding HTML table inside SAP table but it din't work! Or is there a way i can split the cell and associate controls to the split up section? Plz help me in this regard ASAP.
Thank you,
Madhesh.
you can mail to my personal Id if this doesnot solve your problem.
Edited by: Ashutosh Sarwade on Dec 27, 2007 7:49 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhesh,
I am able to SAP table in HTML table. Here is the sample code where I have added SAP table in the first cell of HTML table. Let me know if this solves your problem.
protected void Page_Load(object sender, EventArgs e)
{
BuildTable();
//Adding table inside a table
//code starts here
objParentTable.BorderColor = "#000000";
HtmlTableRow trHeader = new HtmlTableRow();
trHeader.ID = "trhdr0";
HtmlTableRow trHeader1 = new HtmlTableRow();
trHeader1.ID = "trhdr1";
HtmlTableCell tcellHeader = new HtmlTableCell();
tcellHeader.ID = "tcheadercell0";
tcellHeader.BgColor = "#999999";
TextView objTextViewHeader = new TextView();
objTextViewHeader.ID = "objtxtview0";
objTextViewHeader.Text = "Column1";
tcellHeader.Controls.Add(objTextViewHeader);
trHeader.Cells.Add(tcellHeader);
objParentTable.Visible = true;
objParentTable.Rows.Add(trHeader);
HtmlTableCell tcellHeader1 = new HtmlTableCell();
tcellHeader1.ID = "tcheadercell1";
tcellHeader1.BgColor = "#999999";
TextView objTextViewHeader1 = new TextView();
objTextViewHeader1.ID = "objtxtview1";
objTextViewHeader1.Text = "Column1";
tcellHeader1.Controls.Add(objTextViewHeader1);
trHeader.Cells.Add(tcellHeader1);
objParentTable.Visible = true;
objParentTable.Rows.Add(trHeader1);
HtmlTableRow trFirstRow = new HtmlTableRow();
trFirstRow.ID = "tr0";
HtmlTableCell tcellDetails = new HtmlTableCell();
tcellDetails.ID = "tc0";
tcellDetails.BgColor = "#ffffff";
TextView objTextViewDetails = new TextView();
objTextViewDetails.ID = "txtvw0";
objTextViewDetails.Text = "Hi";
//Add table inside the HTML table
tcellDetails.Controls.Add(objTableToAdd);
trFirstRow.Cells.Add(tcellDetails);
HtmlTableCell tcellDetails1 = new HtmlTableCell();
tcellDetails1.ID = "tc1";
tcellDetails1.BgColor = "#ffffff";
TextView objTextViewDetails1 = new TextView();
objTextViewDetails1.ID = "txtvw0";
objTextViewDetails1.Text = " How R U?";
tcellDetails1.Controls.Add(objTextViewDetails1);
trFirstRow.Cells.Add(tcellDetails1);
objParentTable.Rows.Add(trFirstRow);
//code end here
}
private void BuildTable()
{
objTableToAdd.Items.Clear();
objTableToAdd.NewRow();
((TextView)(objTableToAdd.Items[0].Cells[0].TableCellContent)).Text = "Table";
objTableToAdd.NewRow();
((TextView)(objTableToAdd.Items[0].Cells[1].TableCellContent)).Text = "to be added";
}
Regards,
Ashutosh
Edited by: Ashutosh Sarwade on Dec 27, 2007 7:39 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhesh,
Unfortunately, it is not possible. The reason for it is the fact that control used as a table cell content should implement SAP.Web.UI.Controls.ITableCellEditor interface. SAP controls such as InputField, Checkbox, etc implement this interface therefore it is possible to use them inside the SAP Table.
Regarding splitting the table cell, it is not possible as well.
Regards,
Rima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhesh,
No, you can use only one control in the table cell. It seems that you have 2 following options:
1. To use 2 columns with one control in each table cell instead of 1 column with 2 controls in each table cell ( if it is applicable to your use case ).
2. To use Datagrid control and then use SAP Portal Style Designer in order to give it SAP look & feel. See following [documentation|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/95628888-0d01-0010-7d97-f0d771999d0f] go to table of contents, Programming with PDK for .NET -> Using Portal Style Designer chapter.
Regards,
Rima.
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.