How to hide the column header for a Devexpress GridLookUpEdit? - vb.net

I currently have a DevExpress GridControl where one of the columns have a GridLookUpEdit assigned under ColumnEdit. Yet when I run there is a column name (the display member) that shows up.
I know with a LookUpEdit you can set the column headers to invisible with lookupedit.Properties.ShowHeader = False but I have no clue how to make it invisible for the GridLookUpEdit.

Use:
lookupedit.Properties.View.OptionsView.ShowColumnHeaders = False

Use the following code to hide a column:
gridLookUpEdit1.Properties.View.Columns("SomeFieldName").Visible = false

What you do is run the property editor, go to columns and select the column that your lookupedit is assigned to. Then expand your column edit, then the view within, then the OptionsView. Then set ShowColumnHeaders to false. This will set all of the column headers within the lookupedit to false.

For devexpress 18.2.8
I'm using the following code to hide a column:
using (DataTable dt = rst.ResultSet.Tables[0].Copy())
{
dt.Columns["Unit_ID"].ColumnMapping = MappingType.Hidden;
ddlUnitOfMeasurement.Properties.DataSource = dt.DefaultView;
ddlUnitOfMeasurement.Properties.ValueMember = "Unit_ID";
ddlUnitOfMeasurement.Properties.DisplayMember = "Unit_Name";
}

Related

Format UltragridRow Cells

I need to format the cell of an UltraGrid.
Like: Making the cell to format a DateTime.
I have done for a column,
UltraGridColumn.Format = "d"
likewise is there any option to format individual cells?
UltraGridRow.Cells("abc")= ?
Note: Using the Infragistics version 12.1
The trick to force the UltraGrid to use different editors for cells in the same column is based on a set of programming objects and patterns offered by the infrastructure of the control.
The first thing is to consider is the InitializeRow event. This event is called for each row when you set the initial DataSource of the grid or when you change something in the underlying DataSource. You can differentiate between the two situations thanks to the e.Reinitialize flag. If it is false, then the whole datasource is applied to the grid, if it is true then only a subset of rows are reinitialized usually because the user has edited the cell or the code has changed a value in the datasource.
The second thing to consider is the Editor property present in every UltraGridCell or UltraGridColumn. It is an object that is built automatically by the UltraGrid to allow the cell editing. The UltraGrid code set this object based on the datatype of the column and, obviously, sets the same editor for every cell of the column. You could set your own editor at the column level (usually in the InitializeLayout event) or on cell by cell basis looking at your formatting rule.
Let's try an example (Big parts of this is taken from the example code suggested in its comments by Alhalama)
Suppose you have a DataTable with only two columns:
First column is called CONDITION and contains a string. This string is my formatting requirement.
The second column is called DATEINFO and contains the dates that should be formatted differently accordingly to the value in the column CONDITION.
So if CONDITION = 'TEST1' then the DATEINFO cell is formatted with Day/Month/Year pattern, if the CONDITION='TEST2' then the DATEINFO cell should be formatted with Hour/Minute/Seconds.
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
{
if (e.ReInitialize == false)
{
DefaultEditorOwnerSettings editorSettings;
DateTimeEditor datetime_editor;
string condition = e.Row.GetCellValue("Condition").ToString();
switch (condition)
{
case "TEST1":
editorSettings = new DefaultEditorOwnerSettings()
editorSettings.DataType = typeof(DateTime);
editorSettings.MaskInput = "mm/dd/yyyy";
datetime_editor = new DateTimeEditor(new DefaultEditorOwner(editorSettings));
e.Row.Cells["DateInfo"].Editor = datetime_editor;
break;
case "TEST2":
editorSettings = new DefaultEditorOwnerSettings()
editorSettings.DataType = typeof(DateTime);
editorSettings.MaskInput = "hh:mm:ss";
datetime_editor = new DateTimeEditor(new DefaultEditorOwner(editorSettings));
e.Row.Cells["DateInfo"].Editor = datetime_editor;
break;
}
}
}

changing the color of one cell in a datagrid after grid was startet

I have problems to change one cell of a datagrid after the grid is started. I want to change the colour of some cells and I need to ask if this cell has another value as a cell in another column, and then if this is true to change the colour.
How can i do this?
Try
var rows = dojo.query(".dojoxGridRow", grid.domNode);
var cellsInSecondRow = dojo.query("td", rows[1]);
var cellTwoInSecondRow = = dojo.query("td[idx='1']", rows[1]);
etc..

Nested List toolbar

I am creating a nested list and setting the BackText on item tap using "setBackText()". That works fine.
But at the same time, I want the title of the toolbar to be set as well.
The code:
onItemTap : function(nestedList, list, index, node, record, e) {
var partsOfStr = record.get('text').split(';');
val = partsOfStr[2];
currDocument = val;
Ext.getCmp('nestedList').setTitle('HII');
Ext.getCmp('nestedList').setBackText(currDocument);
},
does not seem to be working for me.
Any suggestions?
Thanks in advance.
updateTitleText is by default set to true for nestedlist, so if you are using a data store to set the data for your nestedlist, your title will always be set according to which category of data you are selecting.
So, set
updateTitleText: false
and then try to set the title dynamically like this,
Ext.getCmp('nestedList').setTitle('HII');

How can I show a summary in the footer of a win grid and not have the Sigma show up in the header?

I'm using an Infragistics UltraWinGrid and would like to be able to display the sum of several columns. I got that working by allowing row summaries. However, I only want them to be able to see the sum, not have all these other crazy options that come along with that little sigma in the header. How can I get rid of this while keeping the sums at the bottom?
You should have the DisplayLayout.Override.AllowRowSummaries property set in this way:
DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.Default;
then use code like this to create your summary
(Need to check before creating another summary with the same name)
private void BuildCurrencySummary(string name, UltraGridColumn col)
{
SummarySettings ss = grd.DisplayLayout.Bands[0].Summaries.Add(name, SummaryType.Sum, col);
ss.SummaryPositionColumn = col;
ss.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
ss.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
ss.Appearance.ForeColor = Color.Black;
ss.Appearance.TextHAlign = HAlign.Right;
ss.DisplayFormat = "{0:C}";
}
From Infragistics Forum :
You can still apply summaries to a column without setting the AllowRowSummaries property.
The purpose of the AllowRowSummaries is to show (or not show) the interface for the user to establish their own summaries. This is the "sigma" symbol you were seeing.
From the Override object, set the AllowRowSummaries property to False.
UltraGrid1.DisplayLayout.Override.AllowRowSummaries = Infragistics.Win.UltraWinGrid.AllowRowSummaries.[False]

How to filter flex datagrid with three check boxes.?

I am new to flex.
I need your help. Can anyone help me please.
My Requirement:
Flex Datagrid should be filter based on 3 checkboxes.(Checkboxes can be checked with several combinations).
My Code:
Checkboxes:
Data Provider:
MXML code:
Here i have to filter the datagrid when i check the different combinations of 3 checkboxes.
The checkbox values are from Staus column of arraycollection.
When i select 'completed' checkbox and 'onhold' check box, datagrid should display only those records which have Status as "Completed" & "On Hold".
Similarly for all combinations of c
Can anyone give simple solution please ?
Thanks,
Anand.k
Use an ArrayCollection as your dataProvider and assign a filtering function to its filterFunction property :
var provider:ArrayCollection;
At the part where you instantiate your array, give it a filterFunction :
provider.filterFunction = myFilteringFunction;
With the code of the filterFunction like this :
private function myFilteringFunction(item:ObjectTypeInYourArray) : Boolean {
var show:Boolean;
if(item.completed == checkBox1.checked &&
item.onHold == checkBox2.checked){
show = true;
}
return show;
}
It's an example with two checkboxes. The type of value assigned to the completed and onHold attributes of your object may not be boolean so you'll have to convert them somehow before comparing them to the state of the checkboxes but I think you get the idea.
Basically the filterFunction that you pass to your arraycollection is applied to each of the items inside and return true or false depending on you code inside (e.g check if the object has the right values for its properties). When true the values are showed
At the change events of your checkboxes, you refresh the dataProvider :
provider.refresh();
Hope that helps