Datagrid and combobox
Hi all,
I have two issues...
First is that my combobox in datagrid is not populating...
Here is the code:
private function openWindow():void
var testWindow:TitleWindow = new TitleWindow();
testWindow=TitleWindow(PopUpManager.createPopUp(this, test, true));
testWindow["Id"]=testDG.selectedItem.ID;
private function handle_returnTestAC(e:ResultEvent):void
testArray=ArrayCollection(e.result);
<mx:DataGrid
toolTip="Click for Description" id="testDG" dataProvider="{testAC}" doubleClickEnabled="true" eventClick="openWindow()">
<mx:columns>
<mx:DataGridColumn dataField="ID" headerText="ID" />
<mx:DataGridColumn dataField="Michigan_Produce" headerText="Michigan Produce" />
<mx:DataGridColumn headerText="Type" dataField="TypeName"> <mx:itemRenderer>
<mx:Component>
<mx:ComboBox prompt="Type" dataProvider="(testArray)" labelField="TypeName"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
If i call this combobox outside the Datagrid it works:
<mx:ComboBox id="cmb" dataProvider="{testAC}" labelField="TypeName" prompt="Type"/>
2. Problem is that how do I make "Type" DataGridColumn not double click enabled. as when I make a selection in the combobox it does not open the pop up...
I'll really appreciate any help... thanks...
1. Try dataProvider="{outerDocument.tesArray}"
2. I didn't understand the question
Similar Messages
-
Synchronization between datagrid and chart Item
Hi
In my application, I have a datagrid and corresponding bar
chart. there is a toggle button through which I can switch between
chart and data grid.
Now I want to synchronize both.
for example If I select any 3 rows in data grid then it
should selects 3 bars on the chart also.
can any body help me in that?
Thanks
smonika15Hi,
U need to have a combo box renderer something like:
In the object that u are populating the data provider of the
data grid, add 2 fields:
listOfFields & selectedField.
<mx:HBox horizontalScrollPolicy="off"
verticalScrollPolicy="off"
xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
public var itemSelected: Object;
]]>
</mx:Script>
<mx:ComboBox id="combo"
dataProvider="{data.listOfFields}"
selectedItem="{data.selectedField}"
change="itemSelected=combo.selectedItem;"
updateComplete="itemSelected=combo.selectedItem;">
</mx:ComboBox>
</mx:HBox>
Now, loop through the list of objects that u get from
back-end and keep setting the 2 new properties (listOfFields &
selectedField). For setting the value of selectedField, u need to
loop through listOfFields to match the fieldId.
Hope that helps,
Cheree -
How to delete a selected row from datagrid and how to create a datagrid popup
hi friends,
I am new to flex.i am doing a flex4 application,i need help for this.
i am having a data grid with columns.i have two questions.
Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
Second screen: search button ----> it need show datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
This is my requirement.
Any suggession welcome.
Thanks in advance.
B.VenkatesanLets break the problem statement in multiple steps
1. We need a way to know the selection on all rows.
2. We need the association of the checkBox with the data
The solution is to use a arrayCollection/array that holds all the instances created for checkbox.This collection should be a property of component containing the datagrid. We need to use a custom component implementation or inline ItemRenderer. The way you have used is called dropinItemRenderer. Preferaly use custom component implementation and add the instance to the arrayCollection at CreationComplete. Make sure you use addItemAt so that you add the instance in the same row as the data. To get rowIndex the custom Checkbox should implement IDropInListItemRenderer. You could iterate this collection to check all the instances that are checked.
Note: This is the approach considering your dataprovider doesnt have a selection field.
Nishant -
How to delete a Selected row from datagrid and how to create a datagrid popup with saved values
hi friends,
I am new to flex.i am doing a flex4 application,i need help for this.
i am having a data grid with columns.i have two questions.
Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
Second screen: search button ----> it need show datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
This is my requirement.
Any suggession welcome.
Thanks in advance.
B.VenkatesanLets break the problem statement in multiple steps
1. We need a way to know the selection on all rows.
2. We need the association of the checkBox with the data
The solution is to use a arrayCollection/array that holds all the instances created for checkbox.This collection should be a property of component containing the datagrid. We need to use a custom component implementation or inline ItemRenderer. The way you have used is called dropinItemRenderer. Preferaly use custom component implementation and add the instance to the arrayCollection at CreationComplete. Make sure you use addItemAt so that you add the instance in the same row as the data. To get rowIndex the custom Checkbox should implement IDropInListItemRenderer. You could iterate this collection to check all the instances that are checked.
Note: This is the approach considering your dataprovider doesnt have a selection field.
Nishant -
Hi all,
I am using Scene Builder and I have two questions about Choice Box.
1) What is the difference between ChoiceBox and ComboBox? It seems both have same features and functionalities
2) How to change default item1, item2, etc, font style and size on a ChoiceBox or ComboBox from SceneBuilder? I see I can set my own custom items names from FXML file but I would prefer to accomplish from SceneBuilder if possible.
Thanks
Alberto1) What is the difference between ChoiceBox and ComboBox? It seems both have same features and functionalitiesThe difference between a ChoiceBox and a ComboBox comes down to the method of display: a ChoiceBox uses menus, a ComboBox uses a ListView.
A ChoiceBox well-suited to a small number of choices
A ComboBox well-suited to a large number of choices. -
How2 load xml into datagrid, and create realtime search of datagrid data
I wanted to be able to load xml data into a datagrid and then create a searchbox that would search in real time (as person typed) from any part of the datagrid. Does anyone know of any as2.0 component that can do that easily? If not, i would like to try to tackle this the old fashioned and use this to teach myself as2.0 advanced coding. can someone point to a step by step or explain how i might get this accomplished? from loading the xml to putting the node info into the datagrid, to being able to search it in real time. This is part of a project that i was given that has some serious consequences if i botch it. Please help! Thanks so much!
import fl.controls.DataGrid;
import fl.controls.ScrollPolicy;
import fl.data.DataProvider;
import flash.net.URLLoader;
import flash.events.Event;
var dp:DataProvider = new DataProvider();
var dg:DataGrid = new DataGrid();
dg.columns=["User","Xp","Rank"];
addChild(dg);
var urlloader:URLLoader = new URLLoader();
urlloader.addEventListener(Event.COMPLETE,loadcompleteF);
urlloader.load(new URLRequest("whatever.xml"));
function loadcompleteF(e:Event):void {
var xml:XML=XML(e.target.data);
for (var i:int = 0; i < xml..Name.length(); i++) {
dp.addItem({User:xml..Name[i].User.text(), Xp:xml..Name[i].Xp.text(), Rank:xml..Name[i].Rank.text()});
dg.dataProvider=dp; -
GridView vs DataGrid and gateway
Used to use DataGrids and in a template field Hyperlink, the portal converts the link to a fully gatewayed link... GridView Hyperlinkfield does not get "gateway converted"? Thoughts? Guess I could use a TemplateField, but was hoping to use a more default solution.
EDIT: it appears that a template column with a hyperlink in a GridView does not get "gateway converted" either, hmmmm. Back to tesing and tinkering
EDIT: I am a moron....have to set the gateway prefix in teh Web Service.....jsut shoot me now! TGIF!
Edited by: mbowles on Nov 7, 2008 7:56 AM
Edited by: mbowles on Nov 7, 2008 8:00 AMDoh..built my web app in VS2008 w/o using the app accel / AquaLogicWCLoader. It started out as a LINQ o/r mapping experiment - but am trying to take a step further and get into the portal. I'll tweak the web app (referenes to idk and wcloader, web forms into partial classes inheriting from BEA.ALI.Web.UI.ALIPortletPage) and see if that fixes. I'll keep the group posted.
Bah-zing! It worked. As usual, thanks again, Joel!
Edited by: tjannotta on Feb 17, 2009 9:37 AM -
Revision: 10209
Author: [email protected]
Date: 2009-09-12 17:36:41 -0700 (Sat, 12 Sep 2009)
Log Message:
reverting commit 10198, which affected animation for some halo components like Tree and ComboBox. Should wait for either the real fix (involves RPC changes) or at least a fix that limits the scope to only Flex4 effects instead of all uses of UIComponent.suspendBackgroundProcessing.
Modified Paths:
flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as -
Hi all!
I have a DataGrid, and I have two columns where i want to manipulate the data shown. I tried using a labelfunction, but it turns out the labelfunction is called each time I focus out, and not only when the DataGrid is initialized.
I've seen theres an initialize for DataGrid, but how can i use this to manipulate the data from my two columns?
SincerlyHow do you wrap an object? It depends on how you are getting your data. If
you are using RemoteObject or can control the data type being sent over the
wire, I would simply add a new getter to the data class.
The most rudimentary way is something like this: Say you had a ShoppingCart
record:
class ShoppingCartRecord
public var catalogID:int;
A wrapper class might look like:
class DisplayableShoppingCartRecord
public function DisplayableShoppingCartRecord(orig:ShoppingCartRecord)
original = orig;
public var original:ShippingCartRecord;
public function get catalogID():int
return original.catalogID;
private var _displayName:String;
public function get displayName():String
if (!_displayName)
_displayName = yourOldLabelFunction(orig);
return _displayName;
Then at some point, you loop through the original data set and instantiate
the wrapped versions and pass that dataprovider to the datagrid. -
Using same returned data to create datagrid and pie graph
I am trying to find a good example or information on creating
charts, initially pie graphs. I will be getting the data from a
MySQL DB via a HTTPService call to a PHP script. I would like to
use the same HTTPService call to make a datagrid and build a pie
graph. My datagrid is working fine.
All of the examples I have found show the app with an
internal data source that's hard coded into an array (
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001234.html).
I did search this forum, but it seems most people are just looking
for dynamic pie graphs and there isn't enough in the entries for me
to go off of.
The data returned to the MXML app looks like this:
<auditdata>
<riskdata>
<core>core number here</core>
<subcore>subcore number here</subcore>
<mdata>mdata here</mdata>
<risk1>number here</risk1>
<risk2>number here</risk2>
<risk3>number here</risk3>
</riskdata>
<riskdata>
<core>core number here</core>
<subcore>subcore number here</subcore>
<mdata>mdata here</mdata>
<risk1>number here</risk1>
<risk2>number here</risk2>
<risk3>number here</risk3>
</riskdata>
</auditdata>
When the data is returned, everything under <riskdata>
is put into a datagrid. What I'm looking to do in the pie graph is
this.
Create a 2 different pie graphs for each riskdata (there will
only be 2). The first pie graph will be of the three "risks" (where
their total number equals 100% of the graph). The second pie graph
would be "core - subcore" and risk1 (where the two values total
equals 100%of the graph). I hope that makes sense.
Any guidance would be truly appreciated.
Thanks,
ChrisDoes anyone have any ideas on this?
Thanks,
Chris -
what is the difference between LISTBOX and COMBOBOX?
In other languages list box box will show more than one value to view as per the list box height..But combo box will only givw the values when u press the arrow button...
But in SAP there is only list box which will only display the valkues like the combo box in VB..
REWARSD IFM USEFULK -
Tab not working properly for Datagrid ItemEditor ComboBox
When you run the app type a1 in the find an App combo box then hit the tab key.
Click in the 3rd row in the As Bs column and a combobox will show.
Type a3 and then hit enter. Notice that A3 is saved as the selected item and saved to the dataprovider
Hit the backspace key and hit enter. Notice that the null is saved and nothing is selected.
Type a3 again and hit enter.
Hit the backspce again but this time hit the tab key. Notice the previous value is back. ooops.
{Code}
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:vo="valueObjects.*"
width="100%" height="100%">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
protected function aCBLabel(item:Object):String
if (item != null)
return item.name;
else
return "";
protected function bDG_creationCompleteHandler(event:FlexEvent):void
bDG.selectedIndex = 0;
protected function bAFormat(item:Object, column:DataGridColumn):String
if (item [column.dataField] != null)
return item [column.dataField].name;
else
return "";
]]>
</fx:Script>
<fx:Declarations>
<vo:ADto id="aDto"/>
<vo:BDto id="bDto"/>
<s:ArrayCollection id="aList">
<vo:ADto>
<vo:id>1</vo:id>
<vo:name>a1</vo:name>
<vo:bs>
<vo:BDto>
<vo:id>1</vo:id>
<vo:aDto>
<vo:ADto>
<vo:id>1</vo:id>
<vo:name>a1</vo:name>
</vo:ADto>
</vo:aDto>
</vo:BDto>
<vo:BDto>
<vo:id>2</vo:id>
<vo:aDto>
<vo:ADto>
<vo:id>2</vo:id>
<vo:name>a2</vo:name>
</vo:ADto>
</vo:aDto>
</vo:BDto>
<vo:BDto>
<vo:id>0</vo:id>
</vo:BDto>
</vo:bs>
</vo:ADto>
<vo:ADto>
<vo:id>2</vo:id>
<vo:name>a2</vo:name>
<vo:bs>
<vo:BDto>
<vo:id>3</vo:id>
<vo:aDto>
<vo:ADto>
<vo:id>3</vo:id>
<vo:name>a3</vo:name>
</vo:ADto>
</vo:aDto>
</vo:BDto>
<vo:BDto>
<vo:id>0</vo:id>
</vo:BDto>
</vo:bs>
</vo:ADto>
</s:ArrayCollection>
<s:ArrayCollection id="bAList">
<vo:ADto>
<vo:id>1</vo:id>
<vo:name>a1</vo:name>
</vo:ADto>
<vo:ADto>
<vo:id>2</vo:id>
<vo:name>a2</vo:name>
</vo:ADto>
<vo:ADto>
<vo:id>3</vo:id>
<vo:name>a3</vo:name>
</vo:ADto>
</s:ArrayCollection>
</fx:Declarations>
<fx:Binding source="aCB.selectedItem as ADto" destination="aDto"/>
<s:Form id="AForm" width="700" height="170">
<s:layout>
<s:BasicLayout/>
</s:layout>
<s:HGroup x="0" y="50" width="670" height="60">
<s:Label height="25" fontWeight="bold" text="Find an A" verticalAlign="middle"/>
<s:ComboBox id='aCB'
prompt="Enter or Select an A Name"
labelFunction="aCBLabel"
x="110" y="10" width="375">
<mx:ArrayCollection id="asList" list="{aList}"/>
</s:ComboBox>
</s:HGroup>
</s:Form>
<mx:DataGrid id="bDG" x="10" y="140" width="450" height="200"
editable="true"
dataProvider="{aDto.bs}"
creationComplete="bDG_creationCompleteHandler(event)">
<mx:columns>
<mx:DataGridColumn id="bidDC"
headerText="id"
editable="true"
dataField="id"
editorDataField="value"
width="50"/>
<mx:DataGridColumn id="bNameDC"
headerText="As Bs"
editable="true"
dataField="aDto"
labelFunction="bAFormat"
editorDataField="value"
width="150">
<mx:itemEditor>
<fx:Component>
<s:MXDataGridItemRenderer implements="mx.managers.IFocusManagerComponent">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.events.FlexEvent;
import spark.events.DropDownEvent;
import spark.events.IndexChangeEvent;
[Bindable]
public var bAs:ArrayCollection;
protected function cb_InitializeHandler(event:FlexEvent):void
bAs = outerDocument.bAList;
aDto = outerDocument.bDG.selectedItem.aDto;
if (aDto != null)
var t:ADto;
for (var i:int = 0; i<bAs.length; i++)
t = bAs[i];
if (aDto.id == t.id)
cb.selectedIndex = i;
break;
override public function setFocus():void
cb.setFocus();
public function get value():ADto
if (cb.isDropDownOpen)
cb.closeDropDown(true);
cb.validateNow();
aDto = cb.selectedItem as ADto;
return aDto
protected function cb_closeHandler(event:DropDownEvent):void
aDto = cb.selectedItem as ADto;
]]>
</fx:Script>
<fx:Declarations>
<vo:ADto id="aDto"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:ComboBox id="cb"
width = "100%"
prompt="{aDto.name}"
dataProvider="{bAs}"
labelField="name"
initialize="cb_InitializeHandler(event)"
close="cb_closeHandler(event)">
</s:ComboBox>
</s:MXDataGridItemRenderer>
</fx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</s:Application>
{Code}
{Code}
package valueObjects
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.valueobjects.IValueObject;
import mx.collections.ArrayCollection;
import valueObjects.BDto;
import com.adobe.fiber.core.model_internal;
use namespace model_internal;
public class ADto implements com.adobe.fiber.valueobjects.IValueObject
private var _internal_id : int;
private var _internal_name : String;
private var _internal_bs : ArrayCollection;
model_internal var _internal_bs_leaf:valueObjects.BDto;
public function ADto()
public function get id() : int
return _internal_id;
public function get name() : String
return _internal_name;
public function get bs() : ArrayCollection
return _internal_bs;
public function set id(value:int) : void
var oldValue:int = _internal_id;
if (oldValue !== value)
_internal_id = value;
public function set name(value:String) : void
var oldValue:String = _internal_name;
if (oldValue !== value)
_internal_name = value;
public function set bs(value:*) : void
var oldValue:ArrayCollection = _internal_bs;
if (oldValue !== value)
if (value is ArrayCollection)
_internal_bs = value;
else if (value is Array)
_internal_bs = new ArrayCollection(value);
else if (value == null)
_internal_bs = null;
else
throw new Error("value of bs must be a collection");
private var _managingService:com.adobe.fiber.services.IFiberManagingService;
public function set managingService(managingService:com.adobe.fiber.services.IFiberManagi ngService):void
_managingService = managingService;
{Code}
{Code}
package valueObjects
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.valueobjects.IValueObject;
import valueObjects.ADto;
import mx.collections.ArrayCollection;
use namespace model_internal;
public class BDto implements com.adobe.fiber.valueobjects.IValueObject
private var _internal_id : int;
private var _internal_aDto : ADto;
private static var emptyArray:Array = new Array();
public function BDto()
_internal_id = 0;
public function get id() : int
return _internal_id;
public function get aDto() : ADto
return _internal_aDto;
public function set id(value:int) : void
var oldValue:int = _internal_id;
if (oldValue !== value)
_internal_id = value;
public function set aDto(value:ADto) : void
var oldValue:ADto = _internal_aDto;
if (oldValue !== value)
_internal_aDto = value;
private var _managingService:com.adobe.fiber.services.IFiberManagingService;
public function set managingService(managingService:com.adobe.fiber.services.IFiberManagi ngService):void
_managingService = managingService;
{Code}the reason the tab was not working is because it was not changing the selection and just exiting the combo box. So, in the value function add if (cb.textInput.text == "") cb.selectedIndex = -1; This will change the selection as desired and fixes the problem.
-
Silverlight DataGrid with Combobox rendering problem
As you know that we have already implemented Silverlight application in our application, we need your help to resolve one issue that currently we are facing, actually this is a production bug. We are using Silverligh3 latest version. In our Silverlight
page we have one data grid and inside that we have one dropdown list as a column and others are textboxes. The dropdown lists are attached with the data context using two way binding. Now in order to simulate the issue, add multiple rows (using front-end ‘Add
Row’ custom button) on that data grid at runtime so that scrollbar is coming on the data grid, select data from combo boxes from first two rows, and after scrolling up and down for 2-3times causing combo boxes data disappeared from selected ones and it is
appearing on rows where no values are selected earlier. But if you reload the page then everything is coming as before. And we have checked that the data context object is purely ok and this is a layout refreshing problem only. I do not know whether this is
a bug of Silverlight or not, but as this is a production issue, I need your help urgently.Thanks for your reply. I have simulated the problem in a test page which I have uploaded in this forum. As per your suggestion I have added the code but I doubt whether I have
done it properly. Please check the code as after incorporating the StackPanel also it behaves the same way. You will find the source code for Page1.xaml and the Page1.xaml.vb below in this page. Please review and let me know why virtualization is still active.
Page1.xaml
<navigation:Page x:Class="SLClientApp.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth="640" d:DesignHeight="480"
Title="Page1 Page">
<Grid x:Name="LayoutRoot">
<data:DataGrid Margin="18,0,18,18" VirtualizingStackPanel.VirtualizationMode="Standard" x:Name="dtgTestGrid" ItemsSource="{Binding Mode=TwoWay, Path=TestDataCol}" AutoGenerateColumns="False" >
<data:DataGrid.Columns>
<data:DataGridTemplateColumn Header="Test Combo">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox VirtualizingStackPanel.VirtualizationMode="Standard" Loaded="SetDataForCombo" x:Name="cmbTestCombo" Height="24" Width="120" >
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
</Grid>
</navigation:Page>
Page1.xaml.vb
Imports System.Collections.ObjectModel
Partial Public Class Page1
Inherits Page
Public objTestClassCol As New TestClassCol
Public Sub New()
InitializeComponent()
End Sub
'Executes when the user navigates to this page.
Protected Overrides Sub OnNavigatedTo(ByVal e As System.Windows.Navigation.NavigationEventArgs)
End Sub
Private Sub SetDataForCombo(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
For iCount = 1 To 5
CType(sender, System.Windows.Controls.ComboBox).Items.Add("Value" + CStr(iCount))
Next iCount
End Sub
Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
LayoutRoot.DataContext = objTestClassCol
For iCount = 1 To 30
objTestClassCol.TestDataCol.Add(New TestClass)
Next
End Sub
End Class
Public Class TestClass
Private strLVTestData As String
Public Property TestData() As String
Get
Return strLVTestData
End Get
Set(ByVal value As String)
strLVTestData = value
End Set
End Property
End Class
Public Class TestClassCol
Private objLVTestData As New ObservableCollection(Of TestClass)
Public Property TestDataCol() As ObservableCollection(Of TestClass)
Get
Return objLVTestData
End Get
Set(ByVal value As ObservableCollection(Of TestClass))
objLVTestData = value
End Set
End Property
End Class -
Hi all!
I have a problem that i to reach impasse.There fore,Can you help me?
i am writting code for your's form ,This Form have one datagrid to display data.in datagrid ,I used 1 Combobox to select values for ***(nam,nu), Ok button ,cancel button and new button.
1:
I used code for ok button and update button but it only request command ok but not run update when i changes value of column name child ="nguyen van Huynh"
oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Left = 700
oItem.Width = 65
oItem.Top = 330
oItem.Height = 19
oItem.AffectsFormMode = True
oBtn = oItem.Specific
oBtn.Caption = "&Ok"
Can you help me rewrite code for update button?
2:
I used 1 Combobox to select values for ***(nam,nu) in datagrid.i dont know to write code for combobox in this case.
Can you help me rewrite code for update button?
<a href="http://imageshack.us">[IMG]http://img522.imageshack.us/img522/363/huynhavr0.png[/IMG]</a>
Thank you !Hello Huynh,
As I mentioned before, the simplest solution for your requirement is UDO, therefore you don't need to rewrite the code of update, people here rarely rewrite the update logic of the form, instead just reuse the default implemenation of update in B1. The only magic is databind in your form. You can use UDO Form Generator in B1DE to create the form for you. Form/DataBind has been done. Then the browse, update function has been done by B1.
Also think about the flexibility of design, what if the employee has more than 5 children.
1. Create your own UDT and UDO instead of UDFs in OHEM, thus you can use UDO, you don't need to do with Add, Update.
Example: your UDT can be like this
AMI_OHEM : U_EmpID (This field works a link to EmpID in OHEM, just forget the UDFs in OHEM)
AMI_HEM1: U_Child, U_DateOB, U_*** (Child Table, a matrix of children, support as many as children, just set the valid values for U_***, then it will be generated as comobox in UDO form by UDO Form Generator, by the way the children grid view will be generated as matrix, not grid in the udo form generator.)
2. Use UDO Form Generater in B1DE to generate the form.
3. Open this UDO form when click the view children button in employee master data form.
This is the right way. Hope it is clear
Kind Regards
-Yatsea -
Tab with Cellrenderer and Combobox
When using Cellrenderer to display a combobox in a datagrid, there is an issue with using Tab. If you tab through the cells, it will cause the combobox to erase. To fix this the column needs to be set to non-editable. Problem with doing this is that then you cannot tab to the cell where the combobox is.
Does anyone know a work-around this?Had you RTFA you would have learnt that JTable uses Renderers in the same way you would use a
rubber stamp... thus each header is NOT a seperate Component, but the same component simply
used to paint it....
Following on from this... you may have now what looks very much like an active combo box, this is
just fooling you. It is merely a ghost of a combo box.. some pixels on the screen, nothing more..
First and foremost, before running around in desperate circles - RTFA
Maybe you are looking for
-
Opening and Closing Balances -SAP
Hi experts please explain me about the Opening and Closing Balance in SAP? and what is the use of Opening and closing Balance? regards anand
-
How can i display digits in Chinese Format
Hi, How can i display the digits in Chinese Format? Suppose i have a number 15 as a value. Now in Locale Chinese(Taiwan) it should display the digit as a combination of Chinese character for 10 + 5. So could anyone please tell me what should i do for
-
I have an iPad which I did use a pc to put music onto my iPad with, i also have an iPod touch but have been buying song from iTunes so it has never been used with a pc before... I want to transfer all my music from my iPad to my iPod without using a
-
ITunes crashes on adding large number of files to library
What I do is this: I have a music collection well over 30,000 songs. I want them in iTunes so I go to Add to Library, and I select the folders in which I keep the music in, and let iTunes process them. I do this from an external drive (hfs+, USB2). I
-
iMac (27-inch, Mid 2011) Yosemite 10.10.1 When I start up my iMac with option key held down, the recovery partition is shown as 10.9 instead of 10.10 which is the installed version. How do I install the proper recovery partition?