Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl::Clear() doesn't take into account SetFixedRows(2)
GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28039] |
Fri, 13 August 2010 15:18 |
jeremy_c
Messages: 175 Registered: August 2007 Location: Ohio, USA
|
Experienced Member |
|
|
I can have a real nice header w/FixedRows(2), JoinFixedCells, etc... then call grid.Clear(); and it removes the 2nd header row.
An example:
qsos.AddIndex(ID); // 1
qsos.AddColumn(CALLSIGN, "Basics", 7).HeaderAlignCenter(); // 2
qsos.AddColumn(QSO_DATE, "", 8).HeaderAlignCenter(); // 3
qsos.AddColumn(MODE_ID, "", 5).Edit(mode).SetConvert(mode).HeaderAlignCenter(); // 4
qsos.AddColumn(FREQ_TX, "Freq", 5).Edit(freqTx).HeaderAlignCenter(); // 5
qsos.AddColumn(FREQ_RX, "", 5).Edit(freqRx).HeaderAlignCenter(); // 6
qsos.AddColumn(RST_RCVD, "RST", 3).Edit(rstSent).HeaderAlignCenter(); // 7
qsos.AddColumn(RST_SENT, "", 3).Edit(rstRcvd).HeaderAlignCenter(); // 8
qsos.AddColumn(QSL_SENT, "QSL", 2).Edit(sent).HeaderAlignCenter(); // 9
qsos.AddColumn(QSL_SENT_VIA, "", 3).Edit(sentVia).HeaderAlignCenter(); // 10
qsos.AddColumn(QSL_RCVD, "", 2).Edit(rcvd).HeaderAlignCenter(); // 11
qsos.AddColumn(QSL_RCVD_VIA, "", 2).Edit(rcvdVia).HeaderAlignCenter(); // 12
qsos.AddRow("", "Callsign", "Date", "Mode", "TX", "RX", "S", "R", "S", "V", "R", "V");
qsos.SetFixedRows(2);
qsos.JoinFixedCells(2, 0, 4, 0);
qsos.JoinFixedCells(5, 0, 6, 0);
qsos.JoinFixedCells(7, 0, 8, 0);
qsos.JoinFixedCells(9, 0, 12, 0);
qsos.Editing().Navigating().Searching().ColorCols();
qsos.SetToolBar();
On that setup, perform a Clear(). I've gotten around this for now by:
if (qsos.GetRowCount() > 0)
qsos.Remove(0, qsos.GetRowCount());
but looking at the code I believe my work-around is quite a bit more code executing to perform the same task.
Jeremy
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 15:04:00 CEST 2024
Total time taken to generate the page: 0.02510 seconds
|