Home » Community » Newbie corner » GridCtrl column's .Edit
GridCtrl column's .Edit [message #31530] |
Fri, 11 March 2011 11:44  |
Wlad
Messages: 20 Registered: February 2010 Location: Ukraine, KharkOv
|
Promising Member |

|
|
I want to reset the instance of GridCtrl every time (and frequently )
The main purpose of sucj behavior is to tune GridCtrl to many different float 2d arrays with different sizes.
I do such sequence of actions:
...
grid.Clrear(true);
....
grid. .... .Editing()..SelectRow(false). ...
...
//bla-bla-bla
....
//-------------------
static void SetGridTHeader( GridCtrl& grid, float* t, int tCount, Ctrl& ctrl )
{
for( int i = 0; i < tCount; ++i )
{
float value = t[i];
grid.SetFixed( 0, i+1,::FormatDoubleFix(value, 0, /*FD_SIGN|*/FD_ZERO) );
grid.GetColumn( i ).Edit( ctrl );
}
}
Note! All cells are of float type.
The upmost row (header) is the set of temperature.
The "working cells" are any coefficients used in my application.
Is it right way (ctrl may be the same instance for all columns) or I MUST to pass to .Edit DIFFERENT instances of EditDouble?
[Updated on: Fri, 11 March 2011 11:48] Report message to a moderator
|
|
|
Re: GridCtrl column's .Edit [message #31531 is a reply to message #31530] |
Fri, 11 March 2011 12:26   |
|
You must pass new instance for every column.
Array<EditDouble> edits;
edits.SetCount(tcount);
for( int i = 0; i < tCount; ++i ) {
grid.SetFixed(0, i + 1, FormatDoubleFix(value, 0, FD_ZERO));
grid.GetColumn(i).Edit(edits[i]);
}
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 04:51:13 CEST 2025
Total time taken to generate the page: 0.06164 seconds
|