Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
9364
How to tell the ActiveRow is a TemplateAddRow
posted

Question 1: I am binding to a parent-child-grandchild table relationship. So have band for each in my Grid. I have TemplateAddRow for the child band (second band in the hierarchy). In InitializeRow handler how I tell the ActiveRow is the TemplateAddRow? I have the following code

UltraGridRow activeRow = ((UltraGrid)sender).ActiveRow;

if (activeRow.Equals(((UltraGrid)sender).Rows.TemplateAddRow) //this did not work

{

.....

}

Question 2: for the entire Grid in InitializeLayout I have said:

e.Layout.Override.CellClickAction = CellClickAction.RowSelect;

That's because I do not need to edit any of those rows. However, I want to make the TemplateAddRow editable. Right now, with CellClickAction.RowSelect setting I am unable to enter in that cell.

Parents
No Data
Reply
  • 23930
    Offline posted

    Hello,

    Thank you for contacting Infragistics Developer support.

    1. The InitializeRow event doesn’t fire for TemplateAddRow. There is separate even for that called InitializeTemplateAddRow. Also it seems that the TemplateAddRow can’t be the active row. Once it gets activated it becomes a normal row. If you need to find if the active row comes  from template add row, you could use the IsAddNew property of the UltraGridRow in the InitializeRow event.
    2. In order for the the TemplateAddRow to be the only row that is editable in the band, instead of the CellClickAction you could use the Activation property of the UltraGridRow. You can set the activation of all the rows which aren’t AddNew to ActivateOnly.

    I have attached a simple sample which demonstrates these suggestions.

    Please let me know if you have any additional questions.

    WG_TemplateAddRowSample.zip
Children