cancel
Showing results for 
Search instead for 
Did you mean: 

Disable first two rows in a table control

Former Member
0 Kudos

How to disable first two rows of a table control on a view?

Thanks

Sat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You have to do this at the table column cell editor level for the first two.

Create a calculated attribute of type boolean code as follows

Bind this attribute to the enabled property of individual cell editors.


//@@end
  public boolean getEnabled(IPrivateExportTableDataCompView.IContextElement element)
  {
    //@@begin getEnabled
	if(element.index() == 1 || element.index() == 2)
		return false;
    return true;
    //@@end
  }


Regards

Ayyapparaj

Former Member
0 Kudos

That should be


return element.index() > 1;

Armin

Former Member
0 Kudos

Thank you all for responding with productive solutions!

Here are my additional requirements.

First two rows are "not selectable" and "not editable"

Users will be copying rows from other table. All the copied rows should be selectable and editable.

Created a calculated boolean context parameter and bound it to individual cell editors and rowSlectable property of Table. Also, wrote the code in getEnabled method to return false for first two rows. This config is making the first two rows "not selectable" and "not editable". Also, it's allowing copied rows editable. However, copied rows are becoming "not selectable"... this is an issue.

Any ideas.

Thanks

Former Member
0 Kudos

Create 2 context attributes of type boolean in the node that you are binding to the table. One for Row selectable and another for read only. Bind one attribute to row selectable property of the table and set the first element attribute value to "false" and rest of the elements would be true. This will make the first row not selectable. If you need to disable the column table cell editor fields of the first row, bind the readonly property of each column cell editor to 2nd boolean attribute and set it to true for the first element. Set it to false for rest of the elements. This will set the editors in first row to read only and rest of the rows are enabled to edit.

Hope that helps.

Former Member
0 Kudos

That was it! Thanks Anu! I got it solved.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

create one extra attribute of boolean type where the attributes of the table are defined.

and bind the attribute with enable property of the "table cell editor".

while populating the values into the table set the boolean attribute value to false for first two rows and true for remaining rows.

hope it helpful to you.

Regards,

ramesh

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Go through the following threads, It is solved

[;

[;

Regards

Raghu

Former Member
0 Kudos

Hi,

Please check the follwoing SDN forum discussion:

former_member192434
Active Contributor
0 Kudos

Hi Sat,

Select the table row and set the visible property as a blank.

Thanks