Hi I have a scenario where I am creating table inside 2 seperate grid columns. I want the tables inside both the columns to be the same size.
For ex table 1 can have 4 rows while table 2 can have 6 rows. I match up the rows in table1 and table2 and if there is no matching row I add an empty cell to that row.
I want the rows to have the same height so the rows look aligned with the data... data in table1 to data in table2 or empty row in table1 to data in table 2. or if the data in table2 wraps to two lines then the corresponding row in table1 to have the same height.
Currently, they don't align well as the rows with empty space don't take up any height.
I've tried adding row height but that doesn't help.Please suggest
below is my code:
GridDataItem item = e.Item as GridDataItem;
int accountID = Int32.Parse(item.GetDataKeyValue("AccountID").ToString());
DataRow[] dr = PayoutElection.GetPayouts_ByAccount_ListByParticipant(Int32.Parse(Profile.ParticipantID), accountID, PayoutTypeFilter);
Table tblPayoutType = new Table();
Table tblPayoutDesc = new Table();
Table tblEffectiveDate = new Table();
foreach (DataRow row in dr)
{
TableRow trPayoutType = new TableRow();
trPayoutType.Attributes.Add("class", "mergedItems");
TableRow trPayoutDesc = new TableRow();
trPayoutDesc.Attributes.Add("class", "mergedItems");
TableRow trEffectiveDate = new TableRow();
trEffectiveDate.Attributes.Add("class", "mergedItems");
TableCell cellPayoutType = new TableCell();
cellPayoutType.Text = row["PayoutType"].ToString();
TableCell cellPayoutDesc = new TableCell();
cellPayoutDesc.Text = row["PayoutDescription"].ToString();
TableCell cellEffectiveDate = new TableCell();
DateTime effDate = (DateTime)row["EffectiveDate"];
DateTime currentDate = DateTime.Parse(Profile.CurrentDate);
cellEffectiveDate.Text = effDate.ToString(Utility.MBFormatDate);
trPayoutType.Cells.Add(cellPayoutType);
tblPayoutDesc.Rows.Add(trPayoutDesc);
trPayoutDesc.Cells.Add(cellPayoutDesc);
tblPayoutType.Rows.Add(trPayoutType);
trEffectiveDate.Cells.Add(cellEffectiveDate);
tblEffectiveDate.Rows.Add(trEffectiveDate);
if (effDate > currentDate)
{
if (cellPayoutType.Text == _currentPayoutType)
{
cellPayoutType.Text = "";
}
}
}
item["PayoutType"].Controls.Add(tblPayoutType);
item["PayoutDescription"].Controls.Add(tblPayoutDesc);