Hello mcseidel ,
I apologize about the delayed answer.
Adding additional elements after the container grid is not supported out of the box. Making changes to the child grid however will trigger updating events like it does for the parent grid.
So in that event you can update the data source of the grid. As for triggering a call to the server. If you have activation behavior enabled the updating will trigger on every cell value changing after you change the active cell. Otherwise if you’ve enabled batch updating any page postback will trigger the updating event.
For editing of only some of the cells you’ll need to enable editing behavior for the child band (container grid you created) and set the EditingColumnSettings correspondingly with ReadOnly to true for the columns that should not be editable and ReadOnly to false for the ones that should be editable.
Please refer to the attached sample and let me know if you have any further questions.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Thanks, that was helpful. I'm moving in the same direction of setting individual behaviors on the instance of the child grid and might ask couple of questions withing this post framework later.
It seems the same as in my sample code. I don’t see anything that might be causing in your code snippet. I can however suggest that you enable the inheritance for the parent band so that the nbehavior will be transferred to the child band as well:
<Behaviors>
<ig:EditingCore EnableInheritance="true">
<ig:CellEditing EnableInheritance="true">
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
Also make sure that you don’t create anew the behavior if it’s already created For example set:
if (childGrid.Behaviors.EditingCore == null)
{
childGrid.Behaviors.CreateBehavior<EditingCore>();
}
if (childGrid.Behaviors.EditingCore.Behaviors.CellEditing == null)
childGrid.Behaviors.EditingCore.Behaviors.CreateBehavior<CellEditing>();
Regarding setting a cell to be read-only . There is currently no direct setting for this. You can only set a specific column to be read-only in the code-behind. You could however handle the entering edit mode client side event (if the column, in which the cell is, is editable) and if the specific cell shouldn’t be editable you can cancel the event. This will make it read-only.
I’m attaching a modified sample with the above mentioned changes. Note that the child column “Item” is not set to be read-only in the code behind but in the editing event for all cells from that column the event gets canceled.
What I am trying to say is that "ItemChild" seems will block enter value into every row of the column "Item" on the child grid..
1. How to access value of the cell
2. Is it a way to attach event to the child only to avoid extra traffic, because right not it goes for every celledit attampt.
You can register the client side event from the CellEditingBehavior for the child grid like this:
childGrid.Behaviors.EditingCore.Behaviors.CellEditing.CellEditingClientEvents.EnteringEditMode = "WHDGChildGrid_CellEditing_EnteringEditMode";
When you register it like this for the child grid the event will trigger only when you enter edit mode in the child grid.
Regarding the value of the current cell you can get it with:
eventArgs.getCell().get_text()
This will return the content of the current cell.
For example if you modify the previous code like this:
function WHDGChildGrid_CellEditing_EnteringEditMode(sender, eventArgs) {
if (eventArgs.getCell().get_text() == "Item 1") {
eventArgs.set_cancel(true);
Then only the cell with text “Item 1” will be read-only. Please refer to the modified sample and let me know if you have any questions.
I am adding this in the rowIslandsPouplating mehod but I get a script error when the child grid expand. Runtime Exception: TypeError: $IG[objName] is not a function
My code:
var child = new ContainerGrid();
e.Row.RowIslands.Add(child);
var selection = new RowSelectors
Enabled = true,
RowNumbering = false,
RowSelectorCssClass = "selector",
HeaderRowSelectorCssClass = "HeaderRowSelector"
};
child.Behaviors.Add(selection);
selection.RowSelectorClientEvents.RowSelectorClicked = "whdg1_RowSelector_RowSelectorClicked";
child.DataSource = dt;
child.DataBind();
I was able to resolve my issues by setting ajaxEnabled to false.
Thank you