|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How set read-only state to a editable column?
How set read-only state to a editable column? [message #5505] |
Thu, 28 September 2006 11:22 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
Hi!
I have a ArrayCtrl with a list of data in which the two first entrances cannot be touched, are read-only. The other rows are read-write and can be removed.
Then, I can't know how to do this: to indicate to the ArrayCtrl that the two first rows are of read only.
the ArrayCtrl are defined :
....
theList.WhenEnterRow = THISBACK(TheListEnterRow);
...
theList.AddColumn(t_("data field")).Edit(editGrid) ;
...
...
Here we have the comented function WhenEnterRow.
void myDlg::TheListEnterRow()
{
int row = theList.GetCursor() ;
theList.Removing( row > 1 ) ; // do not remove the first 2 rows
// with this test screen is not beauty because I cant enter in the edit field but i can't modify it
editGrid.SetEditable(row > 1) ;
// this other test is not good, the row entirely is disabled
editGrid.Enable(row > 1) ;
//This example is not good either since function YesClickEdit I have written
// and in addition she only prevents the fact to publish when I do click.
// I continue being able to publish with Ctrl+Enter
if (row > 1)
theList.ColumnAt(1).YesClickEdit() ;
// in CtrlLib/ArrayCtrl.h I Added
// Column& YesClickEdit() { clickedit = true; return *this; }
else
theList.ColumnAt(1).NoClickEdit() ;
// With this other example the result is catastrophic. Everything works bad
if (row > 1)
theList.ColumnAt(1).Edit(editGrid) ;
else
theList.ColumnAt(1).NoEdit() ;
// In CtrlLib/ArrayCtrl.cpp I Added
//ArrayCtrl::Column& ArrayCtrl::Column::NoEdit()
//{
// if (edit) {
// arrayctrl->RemoveChild(edit) ;
// edit = NULL ;
// }
// return *this;
//}
}
I believe that the best thing would be to intercept the StartEdit function so that it recognizes a read-only column/row, that seems to you?
Nico
|
|
|
|
|
How set read-only state to a editable column?
By: nicomesas on Thu, 28 September 2006 11:22
|
|
|
Re: How set read-only state to a editable column?
By: nicomesas on Thu, 28 September 2006 11:58
|
|
|
Re: How set read-only state to a editable column?
By: mirek on Fri, 29 September 2006 14:52
|
|
|
Re: How set read-only state to a editable column?
By: nicomesas on Fri, 29 September 2006 15:56
|
|
|
Re: How set read-only state to a editable column?
By: mirek on Sun, 01 October 2006 18:49
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: mirek on Tue, 03 October 2006 15:06
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: mirek on Wed, 04 October 2006 11:54
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: unodgs on Wed, 04 October 2006 22:24
|
|
|
Re: How set read-only state to a editable column?
By: unodgs on Thu, 05 October 2006 00:25
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: unodgs on Thu, 05 October 2006 11:27
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: unodgs on Thu, 05 October 2006 15:13
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
|
|
|
Re: How set read-only state to a editable column?
By: unodgs on Thu, 05 October 2006 15:10
|
|
|
Re: How set read-only state to a editable column?
|
Goto Forum:
Current Time: Tue May 14 10:30:12 CEST 2024
Total time taken to generate the page: 0.03166 seconds
|
|
|