Class List
Class to represent a CRM List.
public class List : UIObject, IList<GridCol>, ICollection<GridCol>, IEnumerable<GridCol>, IEnumerable
- Inheritance
-
List
- Implements
- Inherited Members
Constructors
List(string)
Initializes a new instance of List.
public List(string listName)
Parameters
listName
stringMetadata List Name.
Properties
CaptionFamily
Change the caption family used for the grid.
public string CaptionFamily { get; set; }
Property Value
CheckBoxColumn
Sets checkbox column for grid for SelectAll/DeselectAll feature.
public string CheckBoxColumn { get; set; }
Property Value
Count
Gets the number of GridCol contained in the List.
public int Count { get; }
Property Value
CountSql
Set a Custom count SQL to help the grid pagination. This can be used to improve the grid performance. The SQL should return only one record which need to be named fcount and represent the number of record returned by SelectSql + Filter properties.
public string CountSql { get; set; }
Property Value
Examples
Select count(*) as fcount from Company
ExtraRowContent
Use this to set extra attributes on to the <TR> tag for the header row of the list. Default value is blank.
public string ExtraRowContent { get; set; }
Property Value
Examples
List.ExtraRowContent = "height=20";
Filter
This value will be add to the SQL WHERE clause.
public string Filter { get; set; }
Property Value
Examples
Filter := "comp_companyid >= 200 "
HideTitle
Set this to true to remove the title from a list altogether. Default value is false.
public bool HideTitle { get; set; }
Property Value
Examples
List.HideTitle = true;
IsReadOnly
Gets a value indicating whether the List is read-only.
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the GridCol element at the specified index.
public GridCol this[int index] { get; set; }
Parameters
index
intIndex (position) of the element.
Property Value
- GridCol
GridCol.
PadBottom
Control whether to show empty rows in grid or not. Default value is true.
public bool PadBottom { get; set; }
Property Value
Examples
List.PadBottom = false;
RowsPerScreen
Control how many rows are displayed in the grid. Default value is taken from the System default value.
public int RowsPerScreen { get; set; }
Property Value
Examples
List.RowsPerScreen = 8;
SelectSql
Set the base clause of the select used to get rows for grid.
public string SelectSql { get; set; }
Property Value
Examples
Select * from vCompany
SelectUnselectButtonOnClickScript
On click script attached to Select/Deselect button.
public string SelectUnselectButtonOnClickScript { get; set; }
Property Value
ShowNavigationButtons
Set this to false to remove navigation buttons from a list, also removes the X of Y text from the title. Default value is true.
public bool ShowNavigationButtons { get; set; }
Property Value
Examples
List.ShowNavigationButtons = false;
ShowSelectUnselectButton
Turns on/off SelectAll/DeselecAll feature (dependent on CheckboxColumn property).
public bool ShowSelectUnselectButton { get; set; }
Property Value
Title
Set this to override the Title of the list (set it to the caption code as the value displayed will be translated with the "TabNames" family). Typically this would be used if you are not showing the Navigation buttons and you don’t want to display the default title which would include the total number of records.
public string Title { get; set; }
Property Value
Examples
List.Title = "CustomTitle";
Methods
Add(GridCol)
Adds an GridCol to the List.
public void Add(GridCol item)
Parameters
item
GridColGridCol.
Clear()
Removes all GridCols from the List.
public void Clear()
Contains(GridCol)
Determines whether the List contains a specific GridCol.
public bool Contains(GridCol item)
Parameters
item
GridColGridCol.
Returns
- bool
True if the GridCol is found.
CopyTo(GridCol[], int)
Copies the GridCol to an Array, starting at a particular Array index.
public void CopyTo(GridCol[] array, int arrayIndex)
Parameters
array
GridCol[]One-dimensional Array that is the destination.
arrayIndex
intIndex in array at which copying begins.
CreateGridCol(string)
Add a new column to the list.
[Obsolete("Use: New GridCol(fieldName); List.Add(GridCol);")]
public GridCol CreateGridCol(string fieldName)
Parameters
fieldName
string
Returns
Execute(string)
This method is obsolete.
[Obsolete("Use the property filter and add the list to AddContent")]
public string Execute(string whereFilter)
Parameters
whereFilter
string
Returns
~List()
Destructor for the List class.
protected ~List()
GetEnumerator()
Returns an enumerator that iterates through a collection.
public IEnumerator<GridCol> GetEnumerator()
Returns
GetGridCol(string)
This method is obsolete.
[Obsolete("Use the sintax List[i]")]
public GridCol GetGridCol(string fieldName)
Parameters
fieldName
string
Returns
GetViewHtml(string)
This method is obsolete.
[Obsolete("Use the property filter and add the list to AddContent")]
public string GetViewHtml(string whereFilter)
Parameters
whereFilter
string
Returns
HtmlBody()
Returns the list HTML Body.
protected override string HtmlBody()
Returns
- string
HTML String.
IndexOf(GridCol)
Determines the index of a specific GridCol in the List.
public int IndexOf(GridCol item)
Parameters
item
GridColGridCol.
Returns
- int
Index.
IndexOf(string)
Determines the index of a specific GridCol in the List.
public int IndexOf(string fieldName)
Parameters
fieldName
stringFieldname of column.
Returns
- int
Index.
Insert(int, GridCol)
Inserts an GridCol to the List at the specified index.
public void Insert(int index, GridCol item)
Parameters
Remove(GridCol)
Removes the first occurrence of a GridCol from the List.
public bool Remove(GridCol item)
Parameters
item
GridColGridCol.
Returns
- bool
True if successful.
RemoveAt(int)
Removes the GridCol item at the specified index.
public void RemoveAt(int index)
Parameters
index
intIndex.
RemoveGridCol(string)
This method is obsolete. See the method Remove or RemoveAt
[Obsolete("Use the method Remove or RemoveAt")]
public bool RemoveGridCol(string fieldName)
Parameters
fieldName
string