Add A New Row On Client-Side

xiaoxiao2021-03-06  69

Infragistics.Webui.Ultrawebgridfeedback on this topic ...

Add A New Row On Client-Side

Instead of adding a new row by Clicking The AddNew Button on Our Control, You Can Place You OWN Button on The Webform and Add A New Row by Using Client-Scribting.

The follow method should be used to add a new control:. Igtbl_addNew (GridName, BandNumber) where GridName is the name (id) of the Grid, and the BandNumber is the zero-based index for which band to add a new row This method Requires That An Active Row Be Set, or else it will not work.

MS-help: //infragistics_help/infragistics_web/infragistics.Webui.UltraweBGRID.V3/INFRAGITISTICS.WEBUI.ULTRAWEBGRID.V3/ADD_NEW_ROW_ON_CLIENT-SIDE.HTM

Infragistics.Webui.UltrawebGrid

Added Rows and The AddNew Box

The AddNewBox is the area that contains the button that is made available to the user for adding rows to a band in the UltraWebGrid. There is a button provided for each band or level in the hierarchy of the data contained in the UltraWebGrid. By default, the Hidden property of the AddNewBox is set to true; in order to view this area, you would need to set this property to false in order to be able to add rows, the AllowAddNew property needs to be set to true as well The.. Appearance of the addnewbox can be change through the style Object of the addnewbox.

THE FOLLOWING CODE MAKES The AddNewbox Visible, Changes The Setting For Allowing The Addition of Rows and Sets The Backcolor of The AddNewbox:

IN Visual Basic:

UltraweBGrid1.displayLayout.AddnewBox.hidden = false

UltraweBgrid1.displayLayout.Allowaddnewdefault = infragistics.Webui.UltraweBGrid.AllowaddNew.yes

UltraweBGrid1.displayLayout.AddnewBox.style.backcolor = color.red

IN C #:

UltraweBgrid1.displayLayout.addnewBox.hidden = false; UltraWebGrid1.displayLayout.AllowaddNewdefault = infragistics.Webui.UltraWebGrid.AllowadDnew.yes;

UltraweBGrid1.displayLayout.AddnewBox.style.backcolor = color.red;

It is also possible to add rows to the grid through code To add rows through the server-side, use the Add method of the Rows collection The following code will add a new row to the very bottom of the grid..:

IN Visual Basic:

UltraweBGrid1.displaylayout.Rows.Add ()

IN C #:

UltraweBGrid1.displayLayout.Rows.Add ();

If you would like to add rows through client-side script, the Hidden Property of the AddNewBox must be set to false. If you do not want the AddNewBox to be visible, but still want the capability to add rows on the client-side then Use the customrules property of the addnewbox to hide it. The Following Code Will Hide The AddNewbox THROUGH THE CUSTOMRULES PROPERTY:

IN Visual Basic:

UltraweBGrid1.displayLayout.addnewbox.style.customrules = "Display: none;"

IN C #:

UltraweBGrid1.displayLayout.AddnewBox.style.customrules = "Display: none";

The JavaScript Necessary To Add A Row Is Below. The AddNew Must Be Passed The ID of The Grid and The Index of The Band in Which To Add The Row:

IGTBL_ADDNEW ("UltraWebGrid1", 0);

THATERE ILUSTRES The Concepts Discussed in this Topic. The Additional Code Resources Topic Has A Link to this sample as well as Several Others. Look for WebGrid Sample Project # 2.

转载请注明原文地址:https://www.9cbs.com/read-109435.html

New Post(0)