Infragistics.Webui.Ultrawebgridfeedback on this topic ...
Client-Side Object Model - Grid Object
The Grid Object of UltraweBGrid Can Be Obtained within The page Utility Function.
Var Grid = IGTBL_GETGRIDBYID ('UltraWebGrid1');
The grid can also be referenced directly through the definition that is automatically generated for it. If the name of the grid on the server is 'UltraWebGrid1' then a variable called oUltraWebGrid1 will be available from anywhere within the page. The 'o' prefix is A Convertion Used to INDICATE THAT THE VARIABLE IS An Object As Opposed to An Html Element. When a Variable Repens An HTML Element, An 'E' IS Prefixed In Front of IT.
This Topic Also Contains The Following Sections:
Methods Events
PROPERTIES
AddNewboxView
Gets an integer value That INDICES What TYPE THE THETNEWBOX Object Is. This property is read-only and shop not be change.0 = full1 = compact
AddNewBoxVisible
Gets a Boolean Value That INDICES INDNEWBOX IS Visible for The Grid. This property is ready and shop not be change.
AllowAddnew
Gets or sets a value that indicates if the adding rows is permitted in the grid This property can be changed on the client The alignGrid method has to be called after changing the property value in order to reflect changes on the page.0 -.. Not Set1 = yes2 = novar grid = igtbl_getgridbyid ('UltraWebGrid1'); if (Grid.AllowadDNew == 1) {
IGTBL_GETELEMENTBYID ("MyLabel"). Innerhtml = "Press the Button to Add A Row");
}
AllowColsizing
Gets or sets a value that indicates if column sizing is allowed for the grid as a whole This property can be changed on the client.0 - NotSet1 = Fixed2 = Freevar grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.AllowColSizing = 1; Allowdelete
Gets or sets a boolean value That Indicates if row deleding is allowed for the grid as a whole. This property can be be changing on the client.0 - not set
1 = YES
2 = NO
Var Grid = igtbl_getgridbyid ('UltraWebGrid1'); grid.allowdelete = 2;
Allowpaging
Gets a Boolean value that indicates whether grid data is being displayed via paging. If paging is being used to display data, you can use the PageCount and CurrentPageIndex properties to manage paging on the client-side. This property is read-only and should not BE CHANGED.
ALLOWSORT
Gets a value That INDICES if sorting is in effect for the grid. This property is read-only and shop not be change.0 - not set
1 = YES
2 = NO
3 = OnClient
AllowUpdate
Gets or sets a value that indicates if cell editing is allowed for the grid as a whole. You can also use this property to specify that editing is allowed only using row templates, which disables the in-place editing of grid data. This property can be changed on the client. But be careful, if you're going to turn it on / off on the client make sure that you set it to yes on the server and then set on the client to anything you want. Otherwise the HTML code For the Edit Box Won't Be Rendered Down.0 - Not Set1 = YES2 = NO3 = RowTemplateOnlyVar Grid = IGTBL_GETGRIDBYID ('UltraWebGrid1'); grid.allowupdate = 1;
Altclass
Gets or sets a CSS class name value that specifies the style for alternate cells in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.AltClass = "MyAlternateCssClass"; Bands
Gets the array of Band objects for the grid The length of this array is equal to the number of bands in the grid hierarchy There is always at least one Band object in the array.var grid = igtbl_getGridById ( 'UltraWebGrid1');.. Grid .BANDS [0] .Rowsizing = 2;
BlankImage
Gets or sets a string value that determines the image displayed to represent a blank space in the row selector. The purpose of this image is to create proper spacing in the browser. This property can be changed on the client.var grid = igtbl_getGridById ( ' G_ultrawebgrid1 '; grid.blekimage = "MyblankImage.gif";
Cancelpostback
Gets or sets a Boolean value that indicates whether postback should be cancelled when the next event occurs. If a postback is set to occur due to some other client-side activity, setting this property to True will prevent the postback from occurring. This property can Be changed on the client.var grid = igtbl_getgridbyid ('UltraWebGrid1'); grid.cancelpostback = true;
CasesensitiveSort
The property is used on the client to determine whether the client side sorting should consider the letters' case during the sorting procedure. Default value is false. Needs to be set anytime before client side sorting is done to switch between case sensitive / unsensitive sort. HAS no analog on the server side.var grid = igtbl_getgridbyid ('UltraWebGrid1'); grid.casensensitivesort = true;
CellClickAction
Gets or sets an integer value that indicates what action will be taken when a cells are clicked in the grid by default. The property can be changed on the client.1 = Edit 2 = Row Select3 = Cell SelectCollapseImage
Gets or sets a string value that determines the image displayed to denote the collapsing of an expanded row. This property can be changed on the client. New image will appear on the newly added or recently expanded rows only.var grid = igtbl_getGridById ( 'UltraWebGrid1 '); grid.collapseImage = "mycollapseimage.gif";
CurrentPageIndex
Gets an integer value that specifies the index of the page of grid data that is being displayed. This property is only useful when data is being displayed in multiple pages. You can determine whether data paging is being used by checkin the value of the AllowPaging. This Property is Read-Only and Should Not Be Changed.
CurrentedItrowImage
Gets or sets a string value that determines the image displayed when a row is the current, active row and it can be modified using its row template by clicking on the image. This property can be changed on the client. New image will appear after changing The current row.var grid = IGTBL_GETGRIDBYID ('UltraWebGrid1'); grid.currentededitrowImage = "mycurrentediteditrowimage.gif";
CurrentrowImage
Gets or sets a string value that determines the image displayed when a row is the current, active row This property can be changed on the client New image will appear after changing the current row.var grid = igtbl_getGridById ( 'UltraWebGrid1')..; Grid.currentrowImage = "mycurrentrowimage.gif";
EditCellclass
Gets or sets a CSS class name value that specifies the style for cells in the grid that are being edited This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.EditCellClass = "MyEditCssClass"; Element
Returns the HTML element object corresponding to the WebGrid on the page This property is read-only and should not be changed.var element = igtbl_getGridById ( 'UltraWebGrid1') Element;.. Element.style.color = "red";
Events
See Below for Events.
Expandable
Gets an integer value That INDICES if rows are expandable on the page. This protection not be change.1 = yes2 = no
ExpandImage
Gets or sets a string value that determines the image displayed to denote the expansion of a collapsed. This property can be changed on the client. New image will appear on the newly added or recently collapsed rows only.var grid = igtbl_getGridById ( 'UltraWebGrid1' Grid.expandImage = "MyExpandImage.gif";
ExpareAclass
Gets or sets a CSS class name value that specifies the style for the row expansion areas of the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.ExpAreaClass = "MyExpCssClass";
Footerclass
Gets or sets a CSS class name value that specifies the style for footer cells in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.FooterClass = "MyFooterCssClass";
GrouPyRowClass
Gets or sets a CSS class name value that specifies the style for GroupBy rows in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.GroupByRowClass = "MyGroupByCssClass"; HeaderClass
. Gets or sets a CSS class name value that specifies the style for Column Headers in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1'); grid.HeaderClass = "MyHeaderCssClass";
HEADERCLICKACTION
Gets or sets an integer value that indicates what action will be taken when a column headers are clicked in the grid by default. The property can be changed on the client.0 = NotSet1 = Select 2 = SortSingle3 = SortMulti
Id
Returns The HTML ID Property of The Top-Level WebGrid Element On The Page. This Property Is Read-Only and Should Not Be Changd.var ID = OULTRAWEBGRID1.ID;
Indentation
Gets The Number of Pixels Used for Indenting One Band of Rows from another in the grid. This property is ready and shop not be change.
Itemclass
Gets or sets a CSS class name value that specifies default style for cells in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.ItemClass = "MyCssClass";
NeedPostback
Gets or sets a Boolean value that indicates whether a postback should be initiated after the following event occurs. Set this property to True to force a manual postback to occur after the next event. This property can be changed on the client.var grid = igtbl_getGridById ('UltraWebGrid1'); grid.needpostback = true;
NewrowImage
Gets or sets a string value that determines the image displayed to denote a row that has been added This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.NewRowImage = "MyNewRowImage"; NullText
Gets or sets a string value that determines the text displayed to denote a null value in a cell. This property can be changed on the client. Be aware that setting it on the client will not change all the null values in the grid right away , IT WILL BE Applied to Changed and Newly Added Cells Only.var Grid = IGTBL_GETGRIDBYID ('UltraWebGrid1'); Grid.NullText = "[no value]";
PageCount
Gets or sets an integer value that specifies the number of pages being used to display grid data This property is read-only and should not be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Var numpages = grid.PageCount ;
Rowlabelclass
. Gets or sets a CSS class name value that specifies the style for row selector labels in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1'); grid.RowLabelClass = "MyRowLabelCssClass";
Rows
. This property returns all the Row objects for Band 0 in the grid You can use this property to access individual rows in Band 0 and from there gain access to the other bands of the grid.var grid = igtbl_getGridById ( 'UltraWebGrid1'); grid .ROWS [0] .Rowsizing = 2;
Rowselectors
Gets a Boolean Value That INDICES IF ROWS SELECTORS Are Visible On The Page. This Property Is Read-Only and Should Not Be Changed on The Client.1 = YES2 = NO
Rowsizing
Gets an integer value that indicates if row sizing is allowed for the grid as a whole This property can be changed on the client.1 = Fixed2 = Freevar grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.RowSizing = 1; SelCellClass
Gets or sets a CSS class name value that specifies the style for selected cells in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.SelCellClass = "MySelCellCssClass";
SELECTTYPECELL
Gets or sets an integer value that indicates the type of cell selection that is in effect for the grid This property can be changed on the client.0 = NotSet1 = None2 = Single3 = Extendedvar grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid. SELECTTYPECECELL = 2;
SELECTTYPECOLUMN
Gets or sets an integer value that indicates the type of column selection that is in effect for the grid This property can be changed on the client.0 = NotSet1 = None 2 = Single3 = Extendedvar grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid .SelectTypecolumn = 2;
SELECTTYPEROW
Gets or sets an integer value that indicates the type of row selection that is in effect for the grid This property can be changed on the client.0 = NotSet1 = None 2 = Single3 = Extendedvar grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid .SelectTyPerow = 2;
SELGROUPBYROWCLASS
Gets or sets a CSS class name value that specifies the style for selected GroupBy rows in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.SelGroupbyRowClass = "MySelGroupByCssClass";
SelheadClass
Gets or sets a CSS class name value that specifies the style for selected column headers in the grid This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.SetHeadClass = "MySelHeadCssClass"; ShowBandLabels
Gets or sets a boolean value That INDICES IF Band Labels Are Visible on the page.
Sortascimg
Gets or sets a string value that determines the image displayed in the coulmn header of a column that is sorted in ascending order This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.SortAscImg = "AscSortArrow .gif ";
Sortdscimg
Gets or sets a string value that determines the image displayed in the coulmn header of a column that is sorted in descending order This property can be changed on the client.var grid = igtbl_getGridById ( 'UltraWebGrid1');. Grid.SortDscImg = "DscSortArrow .gif ";
Stationary Margins
Sets the margins to be stationary. This property is read-only and shop not be changing on the client.0 = no1 = header2 = footer3 = Headerandfooter
UniqueID
Gets a value that correpsonds to the name of the element on the server. For a simple UltraWebGrid element hosted on an ASP.NET page, this will evaluate to the name of the element that was assigned in the development environment (ie UltraWebGrid1.) For an UltraWebGrid element that is part of a user control, this will evaluate to the name of the user control concatenated with the name of the UltraWebGrid element. The names of the user and the UltraWebGrid element are separted with a colon in server-side code, but the colon is omitted on the client-side to make this property JavaScript friendly So if you have a user control containing an UltraWebGrid, its unique ID on the server might by. "MyWebControl: UltraWebGrid1" while the value returned by the UniqueID property on . the client side would be "MyWebControlUltraWebGrid1" You can use this property to ensure that your client-side code references the correct server-based element.var grid = igtbl_getGridById ( 'UltraWebGrid1'); var thisGridId = Grid.uniqueId; ViewType
Gets an integer value That indeicates the Type of View That IS Displayed for the Grid. This Property Is Read-Only and Should Not Be Changed on The Client.0 = Flat1 = Heirarchical2 = OutlookGroupby
Methods
AddSortColumn
Adds the specified color column to the sorted columns array.
Parameters:
ColiD - The id of the color.
Clear - Boolean Parameter That Specifies WHETER THE CURRENTS OF THE SORTED COLUMNS Array Should Be Clead When the New Column IS Added. if set to
True the Array Is Cleared and The Specified Column Becomes The Only Column In The Array and The Only Sort criterion. if set to
False, The Specified Column Is Simply Added To Any Existing Column in The Array As An Additional Sort Criterion.Aligngrid
Aligns the grid's activation rectangle to the upper-left corner of the data area. If a row is currently active, that row becomes the topmost row. If a cell is active, that cell's row is scrolled to the topmost position, and it's column is Scrolled to the leftmost position.
Parameters:
Param1 - the_first_parameter.
Param2 - The_second_parameter.
BegineDitTemplate
Opens the template for the currently active row. The Template Provides An Alternate Means for The User To Enter Row Data Using Distinct Elements.
Parameters:
NONE.
DeleteseledRows
DELETES Any Rows That Are Currently Selected in The Grid.
Parameters:
NONE.
EndEditTemplate
CLOSES The Editing Template for The Currently Active Row. Changes to the Template 'S Row Data or Discarded.
Parameters:
SAVECHANGES - A Boolean Value That Specifies WHether Changes Made to the Controls in The Template Should Be Applied To The Data In The Row. if Set To
True, Changes Will Be Applied. IF Set To
False, Changes Will Be Discarded.
Find
Searches Through the Grid Data for a Specified String. Regular Expression Syntax Is Supported for Advanced Searches.
Parameters:
Regexp - the regular expression used to seatch the data. this may be omitted on subsequent calls to the
Find method; The Previously Specified Expression Will Be Used to Perform The Search.
Searchup - a Boolean Value That Specifies The Direction of The Search. if set to
True the serach ispeveraged from bottom to top. if set to
False (Or Omitted) The search from top to bottom.
FINDNEXT
SEARCHES THROUGH The Grid Data for a Specified String, Starting At The Location of The Previous Find. Regular Expression Syntax Is Supported for Advanced Searches.Parameters:
Regexp - the regular expression used to seatch the data. this may be omitted on subsequent calls to the
Find method; The Previously Specified Expression Will Be Used to Perform The Search.
Searchup - a Boolean Value That Specifies The Direction of The Search. if set to
True the serach is performed from the position of the previous Find to the top of the data. if set to
False (or omitted) The search is performed from the position of the prep. Find to the bottom.
getActivecell
Returns a Cell Object Representing The Active Cell within the grid.
Parameters:
NONE.
getActiveRow
. The Active Cell in the grid.
Parameters:
NONE.
SelectCellRegion
SELECTS MULTIPLE CELLS IN A Rectangular Region.
Parameters:
Cell1 - The beginning of the selection. This Cell Will Serve As The Anchor of The Selection Area
Cell2 - The end of the selection. This Cell Will Be The last cell class.
SelectColRegion
Selects Multiple Column in the Band.
Parameters:
...................
.
SELECTROWREGION
SELECTS MULTIPLE ROWS IN THE BAND.
Parameters:
row1 -. The beginning of the selection This row will serve as the anchor of the selection range, determining where the selection starts.row2 -. The end of the selection This row will be the last row selected and will determine where the selection range stops .
SetActiveCell
Makes The Specified Cell Element The Active Cell in The Grid. This Cell Will Have A Border Rectangle Drawn Around ITS Perime.
Parameters:
Cell - The Cell Object to Be Made Active.
SetActiveRow
Makes The Specified Row Element The Active Row In The Grid. This Row Will Have A Border Rectangle Drawn Around ITS Perimeter.
Parameters:
Row - The Row Object to Be Made Active.
Sort
This Method Sorts The Grid on the client-side
Parameters:
NONE.
Sortcolumn
Sorts The Grid on The Client-Side Using The Specified Column's Contents as The Sort Criteria.
Parameters:
ColiD - The id of the color.
ShiftKey - Boolean Parameter That Specifies WHETHER TO Perform A Multi-Column Sort. IF
True, The Specified Column Is Added To The Sorted Column Array, And The Sort Is Done Based on The Column in The Array. IF
False or omitted, only a single column is buy. The contents of the sorted columns array defiMN Becomes the Only One in the array.
UnloadGrid
Destroys Any Allocated Variables and Arrays That Have Been Created on The Client-Side by The Control. This Method Should Only Be Invoked from The onunload Event of The Page.
Parameters:
NONE.
Events
The Events object contains over 25 members that are used to specify JavaScript function handlers that are called in response to a variety of events occurring on the client. The Event member is only populated with a valid JavaScript function if the function name is set from the Events object of the DisplayLayout object on the server.All events are called with at least two parameters: The grid name, and the ID of the element on which the event occurred In the case of the BeforeCellUpdate event, an additional parameter is added which specifies. The new value for the cell.
Note That
Gn is the parameter in the grid what the eve ent capt, and
Id is The Object That The Event is on.
The Members of The Events Object Are:
AfterCellUpdate (gn, id) AfterColumnMove (gn, id) AfterColumnSizeChange (gn, id, width) AfterEnterEditMode (gn, id) AfterExitEditMode (gn, id) AfterRowActivate (gn, id) AfterRowCollapsed (gn, id) AfterRowDeleted (gn, id) AfterRowExpanded (gn, id) AfterRowInsert (gn, id) AfterRowSizeChange (gn, id, height) AfterRowTemplateClose (gn, id) AfterRowTemplateOpen (gn, id) AfterSelectChange (gn, id) AfterSortColumn (gn, id) BeforeCellChange (gn, id)
BeforeCellUpdate (gn, id, newValue) BeforeColumnMove (gn, id) BeforeColumnSizeChange (gn, id, width) BeforeEnterEditMode (gn, id) BeforeExitEditMode (gn, id) BeforeRowActivate (gn, id) BeforeRowCollapsed (gn, id) BeforeRowDeleted (gn, id) BeforeRowExpanded (gn, id) BeforeRowInsert (gn, id) BeforeRowSizeChange (gn, id, height) BeforeRowTemplateClose (gn, id) BeforeRowTemplateOpen (gn, id) BeforeSelectChange (gn, id) BeforeSortColumn (gn, id) CellChange (gn, ID)