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
370
TemplateAddRow
posted

Does anyone have have information about TemplateAddRow. I have a requirement that specifies that a row should be at the top of the grid and should be used for adding new row with a add button at the last column.

My question is:

1. Do I need to create a TemplateAddRow or one is automatically defined from the datasource? The property does not allow set at runtime but only get?

2. Is it possible to populate a cell of this template from say another control like radiobutton? When a user clicks on the first cell of templateaddrow, a dropdown will appear to allow the user to select a choice and this will further trigger display of group radio button in another control. When a user selects a radio button, it will automatically populate 2 cells in the template and the user can now click add button to add a new row.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    lanreiseee said:
    1. Do I need to create a TemplateAddRow or one is automatically defined from the datasource? The property does not allow set at runtime but only get?

    You can use one of three settings to get a TemplateAddRow on top.


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {        
                e.Layout.Override.AllowAddNew = AllowAddNew.TemplateOnTop;
                //e.Layout.Override.AllowAddNew = AllowAddNew.TemplateOnTopWithTabRepeat;
                //e.Layout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop;
            }

    lanreiseee said:
    2. Is it possible to populate a cell of this template from say another control like radiobutton? When a user clicks on the first cell of templateaddrow, a dropdown will appear to allow the user to select a choice and this will further trigger display of group radio button in another control. When a user selects a radio button, it will automatically populate 2 cells in the template and the user can now click add button to add a new row.

    The TempateAddRow is just like a normal row in the grid. It has the same columns and same cells as every other row. You can change the editors in a particular cell, but there's no way to add any extra cells that don't already exist in the data source. Perhaps you could use a ContextMenu to allow the user to select some default settings.

Children