A GridColumn having columnEdit set as RepositoryItemComboBox , on changing SelectedItem, Old Item persists - devexpress

A gridCoumn is defined in a Devex Xtra GridControl(winform type).
This column has two properties set :
FieldName --> a field name of a column in dataSource. OptionType
ColumnEdit --> as a RepositoryItemCombobox object , this object's 'Items' properties is having two value : Option1 , option2 & option3.
When data is set at runtime , the GridColumn shows the respective values in 'OptionType' column.
But now i cant change the values in any combobox of this column to other option by using the dropDown.
What am i missing ?????

Related

PeopleSoftModifying field labels while keeping the column label

I have a grid where one column is a column of hyperlinks. How can I set the field labels to display the field's value, while keeping the column's label fixed?
You do this in two steps
set the Grid Column Label
For each row in the grid assign a value to the label of the field associated with the button
Ensure on the page that you have set the page field value for the grid and for the hyperlink column
The example below assumes the field associated with the hyperlink is SELECT_BTN. The column heading will be set to "My Column Title" and the hyperlink on the button will be set to the value of the DESCR field on same record.
Local Grid &grid;
Local GridColumn &hyperlinkColumn;
Local integer &i;
Local Rowset &rowset;
/* set the column header */
&grid = GetGrid(%Page, "MYRECORD");
&hyperlinkColumn = &grid.GetColumn("SELECT_BTN");
&hyperlinkColumn.Label = "My Column Title";
&rowset = GetLevel0()(1).GetRowset(Scroll.SOMERECORD);
/* Set the value for each hyperlink in the rowset */
For &i = 1 To &rowset.ActiveRowCount
&rowset(&i).SOMERECORD.SELECT_BTN.Label = &rowset(&i).SOMERECORD.DESCR.Value;
End-For;

How to get XML value from a column in SQL Server

I have a SQL Server table tblApplications with some columns... one of the columns is called Content and has XML values like in the following Image:
when i clicked on the value of content in the above image it displays like following in new tab
I want to get the value using id from the xml value of dataitem that is under the datagroupItem of datagroup as selected in following image, using query from the tblApplications
How to get the value from the content using id?? E.g. I want to get the value of id of dataitem = 'ForeNames'
How to get it using query????
You could try this query:
SELECT a.application_id,
x.y.query('.') AS DataItemNode,
x.y.value('(#type)[1]','NVARCHAR(50)') AS TypeAttr,
x.y.value('(#value)[1]','NVARCHAR(50)') AS ValueAttr
FROM dbo.tblApplications a
CROSS APPLY a.Content.nodes('/XmlDataPairDocument/dataitem/datagroup/datagroupitem/dataitem[#id="forenames"]') x(y)
or
DECLARE #id NVARCHAR(50);
SET #id='forenames';
SELECT a.application_id,
x.y.query('.') AS DataItemNode,
x.y.value('(#type)[1]','NVARCHAR(50)') AS TypeAttr,
x.y.value('(#value)[1]','NVARCHAR(50)') AS ValueAttr
FROM dbo.tblApplications a
CROSS APPLY a.Content.nodes('/XmlDataPairDocument/dataitem/datagroup/datagroupitem/dataitem[#id = sql:variable("#id")]') x(y)
Another similar questions-answers: here #1, here #2

Drupal - How to use Computed field in field collection item fields

I have custom content type type_a
Inside that custom type I have few titles
Title
Body
Group1 (field_group1) (Field Collection Item Can have multiple values)
Following are the details of fields inside Group1 (Field Collection Item)
Group Item 1 (field_item1) Can have one value
Group Item 2 (field_item2) (Computed field) Can have one value
I would like to copy value of "Group Item 1" field of same field collection item inside "Group Item 2"
Below is I am using in computed code:
$entity_field[0]['value'] = $entity->field_item1[LANGUAGE_NONE][0]['value'];
But it is not working. I am getting an error
Notice: Undefined index: value in eval() (line 1 of /homepages/13/d160804/htdocs/test/sites/all/modules/computed_field/computed_field.module(466) : eval()'d code).
Please help how to do this. Thanks
$entity->field_item1[LANGUAGE_NONE][0]['value'] contains the entity id of the field collection item (which contains the fields you want to copy).
You either need to load both field collection items and set their individual fields. Eg,
$source_fc = field_collection_item_load($entity->field_item1[LANGUAGE_NONE][0]['value']);
$dest_fc = field_collection_item_load($entity->field_item2[LANGUAGE_NONE][0]['value']);
// now set values of $dest_fc with values from $source_fc
Or do some sort of clone similar to this method: http://drupal.org/node/1233256#comment-5167316

If 2 dropdown showing same value on selected index change

I have been asked question on this scenario.There are 2 dropdownlist populating same data from same table one at top and other at bottom.when Item in first dropdownlist get selected,same item is shown in second dropdownlist and second item get selected,same item is selected in first.That means it is continuous loop.How to handle this situation. Don't want to use query
select name from table where id = ddl1.selecteditem.value and execute it.
On selectedindex function of dropdownlist1,he wrote like this
ddl2.selectedItem.value = ddl.selectedItem.value
and second list
ddl.selectedItem.value = ddl2.selectedItem.value
Does it possible to select the value from these 2 statement?I done like this,but not working.
In order to get the same value in both dropdownlists you need to do this in your dropdownlist1_selectedindexchanged:
DropDownList2.Items.FindByValue(DropDownList1.SelectedValue).Selected = true;
The same in dropdownlist2_selectedindexchanged:
DropDownList1.Items.FindByValue(DropDownList2.SelectedValue).Selected = true;
This should keep the same value in both dropdownlists whenever they have been modified.

'Not selected' property value on drop down box selected value

I have an ASP.NET site (either .NET 2.0 or 3.5), and I want to get the selected item of two drop down boxes (call them a and b). B is updated with appropriate values depending on what is selected for A.
However, the following code:
string val = dd1.SelectedItem.Text;
Returns a value of "not selected". Why is this?
Thanks
The only way this could happen is if you have "not selected" set as either the Text property of your selected item, or if Text is null then the Value property will be returned.
From MSDN's documentation on ListItem (which is what SelectedItem inherits from):
If the Text property contains null,
the get accessor returns the value of
the Value property. If the Value
property, in turn, contains null,
String.Empty is returned.

Resources