Data Grid
hi all,
i have two classes.
class User
public String name;
public int age;
public Address address;
class Address
public String city;
I'm passing a List<Users> to the data provider of a
data grid . I can display the values of properties of Users i.e,
name and age.. My issue is how do i display the value of city which
is a propertyt of Address class in the datagrid column..
thanx in advance
"rnjt reddy" <[email protected]> wrote in
message
news:g98a7o$23v$[email protected]..
> hi all,
> i have two classes.
> class User
> {
> public String name;
> public int age;
> public Address address;
> }
>
>
>
> class Address
> {
> public String city;
> }
>
> I'm passing a List<Users> to the data provider of
a data grid . I can
> display
> the values of properties of Users i.e, name and age.. My
issue is how do i
> display the value of city which is a propertyt of
Address class in the
> datagrid
> column..
Use a labelFunction.
HTH;
Amy
Similar Messages
-
08/29/2008 08:58:48 AM
Reply | Quote | Top | Bottom | Edit
hi all,
i have two classes.
class User
public String name;
public int age;
public Address address;
class Address
public String city;
I'm passing a List<Users> to the data provider of a
data grid . I can display the values of properties of Users i.e,
name and age.. My issue is how do i display the value of city which
is a propertyt of Address class in the datagrid column..
thanx in advance
Mark this message as the answer.
Print this message
Report this to a ModeratorHi,
Try labelFunction property of the DataGridColumn.
labelFunction allow you to specify a function name, which will be
invoked when that data is rendered. You will get the Object (User
id your case) corresponding the row being rendered will be passed
as argument to the function. You can use the object and return the
value you want to be displayed.
Please find more details on labelFunction at the URL below
http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#l abelFunction
You can also try custom item renderer.
Hope this helps. -
Can not open data grids or run reports in HFM
Hi
We created an application and have been working in it for weeks without any issues. Just recently once we open the app, we can longer open data grids or run financial grids. The system just hangs and we do not get an error message. Has anyone experienced this? We are wondering if it is a space issue on one of the data base tables.Hello,
I would start by checking with your DBA to see if you have any issues with table space. Next, i would log onto the HFM servers and see if you have any errors being recorded in the Application Event View. If you do have errors in your Event Viewer, can you please post them?
Thanks
Edited by: tonyfeole on Oct 13, 2009 1:33 PM -
Hi there,
I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
database using the fillby query.
It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
each click of the fillby button.
also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered.
so actually 2 questions here:
1. how to populate a new row for each click of the fillby button
2. how to delete records from data grid view after an item has been entered
Thanks
VishwasHello,
The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
Some examples
Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
The following article with code shows this but does not address adapters.
Conceptually speaking the code in the second code block shows how to get the new key
Public Class Form1
Private Sub StudentsBindingNavigatorSaveItem_Click(
sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
Me.Validate()
Me.StudentsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
End Sub
End Class
Get new key taken from
this article.
Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
Dim Success As Boolean = True
Try
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText = InsertStatement
cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
cn.Open()
cmd.ExecuteNonQuery()
cmd.CommandText = "Select @@Identity"
Identfier = CInt(cmd.ExecuteScalar)
End Using
End Using
Catch ex As Exception
Success = False
End Try
Return Success
End Function
In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
Additional resources
http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
Coded UI: How to verify watermark displayed in the fields and Data grid?
Hi,
I've an requirement to verify watermark in the fields say username field displays "Username" water mark when no data is available in the field and water mark in data grid saying "No data available".
Please observe the water mark displayed in screenshot below:
So how to verify watermark?
Thanks & Regards,
Sunil
Best Regards, Sunil Email: [email protected]Hello,
Depending on what form technology you are using, you can try posting to one of the following forums:
Windows Forms General
Windows Presentation Foundation (WPF)
ASP.Net forums
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
Want Access Data Grid control in SharePoint 2013?
Hello everyone!
Recently we noticed something funny in SharePoint 2013. While quite many people were hoping to have the datasheet view like those in SP2007 and 2010, Microsoft has chosen a different interface to display datasheet view.
Now, if you try to create a sub site under a publishing site, and use the
Publishing Site template then try to create a datasheet view in the sub site, SharePoint will try to use the Access data grid control to display the view. In some situations the view will display and other situations it will not, and will show this
error:
The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Microsoft SharePoint Foundation is not installed, your browser does not support ActiveX controls,
a component is not properly configured for 32-bit or 64-bit support, or support for ActiveX controls is disabled.
If you create a sub site using Publishing Site with Workflow instead, then the datasheet view will be created properly using SP2013 interface.
Using PowerShell, we can see that both Publishing Portal and
Publishing Site With Workflow are using the BLANKINTERNET 53 template. The
Publishing Site on the other hand is using the CMSPUBLISHING 39 template.
Want to try it out and let me know if that happens to your SharePoint too?Hi Conway,
I tested the issue in my environment per your description and it returned the results as below:
I created a subsite using Publishing site under a team site in SharePoint server 2013, the datasheet view in a list displayed as pic1
I reproduced the issue in SharePoint server 2010, the datasheet view in a list displayed as pic2
It turns out by design the datasheet view in the subsite based on Publishing site template displays as your situation. Here is an article which explains this:
http://www.sharepointblues.com/2010/03/31/data-sheet-view-not-working/
Regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support -
Hi All,
Account calculations are not displaying on the data grid. But the values are being picked up with a smart view report.
I tried running a force calculate and a consolidate all, but that did not work.
Please suggest in this regards.
Thanks in advance....I tried to use your algorithm to modify my code but i am not able to do that. For this example i am not using any httpservice i am using data services. I created a PHP file i just need to import it into data services planel and drag that services onto data grid it will automatically bring all the data into that data grid. Can you tell me what i need to modify to achive my goal. am using following code
protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
getHorizontalCommentResult.token = horizontalCommentsService.getHorizontalComment();
<mx:DataGrid x="159" y="123" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getHorizontalCommentResult.lastResult}" height="223" width="245">
<mx:columns>
<mx:DataGridColumn headerText="Comments" dataField="Comments"/>
</mx:columns>
PP file
<?php
class HorizontalCommentsService{
public function getHorizontalComment() {
$connection = mysqli_connect("localhost", "root", "root", "my_db", 8889) or die(mysqli_connect_error());
$sql = "SELECT * FROM photo_comments ORDER BY Image_ID DESC";
$result = mysqli_query($connection, $sql) or die('Query Failed: ' . mysql_error($connection));
$rows = array();
while($row = mysqli_fetch_object($result)) {
$rows[ ] = $row;
return $rows;
?> -
BUG in data grid and run script (V1 1467)
Hi,
I found a weird bug in data grid when displaying data defined as NUMBER(10,0).
We have a table with a column defined as NUMBER(10,0). Whenever this column contains data >5000000000 the data in the row shows up as null (empty cell) in the data grid.
I played around a bit and found that running a scrip like select * from testtab where a > 5000000000; with F5 it stops at the first number >5000000000. Running the script with F9 shows all rows correct.
I'm running on WIN2000 using SQL Developer V1 (Build 1467).
The error was not present in Build 1422.I tried the SQL you supplied (by the way, the table name helps in the INSERT statement) and then went to the DATA tab to view the data.
Interesting results.
Even though all of the insert statements executed successfully, only 2 of the rows had any data displaying in columns A and C. All rows had data in column B.
Now for the real fun: by selecting one of the empty cells the "missing" data would appear. Try a commit (yeah, I know nothing has been updated, but SQL Developer doesn't know this) and check out the UPDATE statements that are generated in the log. The cells I selected are being updated with the "missing" data. Refresh the display and the data goes into hiding again.
I don't even want to get into the dangers of a tool updating data when all you've done is to get focus on a field. I've already seen it wipe out the time portion of date/time stamps simply because the default setting for the date/time format does not include the time.
Good start on a tool guys, but it's not quite ready for Prime Time.
BTW...I'm using Oracle 9.i running SQL Developer on Windows 2000. -
after I load a object into data grid created from a web
service it will always seem to create a new blank row. When I get a
error after clicking on it, it always says "-1" for the rows count.
when I shrink the size of the datagrid it elminates some of the
extra row, but still there is a bit of it showing. how do I resize
the datagrid so it doesn't spit out a extra row, or a part of one.
http://www.ctrlzsc.com/other/pic.png
this is a pic showing the extra row, just look where my badly drawn
arrow is pointing to.hi, xyco45
you can set the dataGrid's height and the rowHeight. In my
experience, for example, first, you set the headerHeight="25" and
rowHeight="22", the height will be setted
(headerHeight+rowHeight*(rowNumbers)+1) or
(headerHeight+rowHeight*(rowNumbers)+2), I thought this question
will be solved. -
Is there is way to hide a column in data grid column?
Is it possiblo to reorder the column like in excel . I know its not possible bcoz it <table> tag ...Select the column within the table and in the property window uncheck the visible. You can also include visible="false" in the jsp page within the column tag.
-
Hi,
I have check boxes in data grid, using action script how do i get the values of check boxes that were selected ?
Can anybody guide me here.
<mx:DataGrid id="targetBaseAdd" width="100%" height="100%" dataProvider="
{Application.application.ccModel.initializeBusinessUnitData.initializeBusinessUnit.baseArra y}">
<mx:columns>
<mx:DataGridColumn headerText="" width="20">
<mx:itemRenderer>
<mx:Component>
<mx:HBox width="100%">
<mx:CheckBox horizontalCenter="0"/> </mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Base" labelFunction="baseTargetList"/>
</mx:columns>
</mx:DataGrid>
Thank You,
Anu.
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Base" labelFunction="baseTargetList"/>
</mx:columns>
</mx:DataGrid>
Thank You,
Anu.refer following examples:
http://blog.flexmonkeypatches.com/2007/11/06/datagrid-checkbox-itemeditor/
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_23237167.ht ml -
Hello,
I have to display into a data grid, in Flex 2, 2 columns:
first column ( "Images") must contain a picture with an object and
second column (" quantity") must contain the amount of that object
that I want to buy. The problem is that I must take the name of the
image from an .xml file, specified like this:
<mx:DataGrid id="obj" dataProvider="{ObjList}" > where
ObjList is the .xml file with <name/>
<picture_address/> etc.
The second column must contain a textbox so I can input a
number of items for each picture ( can be also a combobox where
from I can select some value, from 1 to 20 for example).
I've searched the Internet and I haven't found a solution
yet. Please give me a link or a solution for this problem.
Tudoruse itemrenderes.... the example below shows how to add an
image.... you can do the same thing with a text box or combo box
<mx:DataGridColumn width="10" headerText="Image">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas width="100%" height="100%">
<mx:Image verticalCenter="0" horizontalCenter="0"
source="{data.picture_adress}""/>
</mx:Canvas>
</mx:Component>
</mx:itemRenderer> -
Value from data grid not showing in workspace
Hi everyone.
I've entered value in data grid that i maid in Planning for one member. It looks like there is no velue for that member. What needs to be done to recognize new source?
Member is set on Store and is used in some formulas in Dynamic Calc members.
Thx.Maybe it is an implied share, is it is an only child, set the member to "never share", refresh and try again.
Cheers
John
http://john-goodwin.blogspot.com/ -
Bug in 1.5.1 Deleting number value in data grid
Hello,
it is not possible to set a number in a column to NULL by simply deleting the value
DROP TABLE tab_test;
CREATE TABLE tab_test(
dat DATE
,num NUMBER
,var VARCHAR2(2)
INSERT INTO tab_test (dat,num,var)
VALUES (TO_DATE('01.01.2009','dd.mm.yyyy'),4,'ff');
COMMIT;Open the table in SQL Developer and select data tab.
Deleting the date value and commiting is ok
UPDATE "RVS_FE"."TAB_TEST" SET DAT = TO_DATE('', 'DD.MM.YYYY') WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975276'
Commit Successful
Deleting the number value and commiting raises an error
UPDATE "RVS_FE"."TAB_TEST" SET NUM = WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
One error saving changes to table "RVS_FE"."TAB_TEST":
Row 1: ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Rollback Successful
Deleting the char value and commiting is ok
UPDATE "RVS_FE"."TAB_TEST" SET VAR = WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
Commit Successful
Regards
Marcus
Edited by: Marwim on 26.11.2008 08:59Jim, I could reproduce and see the error, no change columns order.
You can use the Marwim script's and, on the data grid, select the column DATE, delete value and commit.
On the data grid, select the column var, delete value and commit.
On the data grid, select the column num, delete value and commit -> get error. -
Data Grid Display child Class data
Hi,
I have 2 Action Script class binded to remote java class
Class 1
package hmil.setup.model
import hmil.com.general.model.Employee;
[Bindable]
[RemoteClass(alias="hmil.setup.model.Area")]
public class Area
public function Area()
public var ARMST_AREA_ID:int;
public var ARMST_CMPN_NO:String;
public var ARMST_CORP_NO:String;
public var ARMST_SCTN_TYPE:String;
public var ARMST_CRTE_USR_NO:String;
public var ARMST_CRTE_TIME:Date;
public var ARMST_UPDT_USR_NO:String
public var ARMST_UPDT_TIME:Date;
public var ARMST_DLR_LIST:ArrayCollection;
public var ARMST_EMP:Employee;
Class 2
package hmil.com.general.model
[Bindable]
[RemoteClass(alias="hmil.com.general.model.Employee")]
public class Employee
public function Employee()
public var EPMST_ID:Number;
public var EPMST_CMPN_NO:String;
public var EPMST_CORP_NO:String;
public var EPMST_EMP_NO:String;
public var EPMST_DLR_NO:String;
public var EPMST_EMP_NAME:String;
When the remote java method returns a list of Area object through Blaze DS this list can be assiged as data to the Data Grid
The DataGridColumn dataField can be mapped to the column name and it displays properly
<mx:DataGridColumn dataField="ARMST_AREA_ID" headerText="Id"/>
But lets say I wanted to display the child value (ARMST_EMP.EPMST_ID ) in the Data Grid
Since the sever returns the Parent Java Object which contains the related Employee as inner Object.
The Objetcs are deserialized to AS class objects.
But how to display the child columns in data grid.
If i give the data field as ARMST_EMP it is displayed as Object. but if i mention the datafield as ARMST_EMP.EPMST_ID, it does not display anything.
please let me know how to display the child object in datagrid
ThanksHi Mugunda, did you ever find out how to do this?
-
OK I think that is resolved but I cannot pull the Data.
The Grid does not populate with data......Just keeps trying to pull it.
THE CFC FUNCTION:
<cffunction name="comments" access="remote" returntype="struct">
<cfargument name="page" required="true">
<cfargument name="pageSize" required="true">
<cfargument name="gridsortcolumn" required="true">
<cfargument name="gridsortdirection" required="true">
<cfquery name="selectAll" datasource="#dsn#" dbtype="#i#">
SELECT autoid, CONVERT(VARCHAR(10), sDate, 101) as sDATE, DAGRSN, branch,
DODAAC, clin, hours
FROM reporting.DAGRSCRAPS
</cfquery>
<cfreturn queryconvertforgrid(selectAll,page,pagesize)/>
</cffunction>
THE DATA GRID ITSELF:
<cfform name="myform" id="myformid">
<cfgrid
name = "myGrid"
format="html"
bindOnLoad="yes"
bind="cfc:pdgps.admin.backoffice.components.Data.comments({cfgridpage },{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
pageSize="10"
preservePageOnSort="true"
selectMode="single"
selectOnLoad="no"
font="Verdana"
fontsize="11"
label="True"
stripeRows="true"
stripeRowColor="##D9CCFF"
selectColor="##994FE6">
<cfgridcolumn name="autoid" display="no" >
<cfgridcolumn name="branch" header="SERVICE" type="string_noCase" >
<cfgridcolumn name="DODAAC" header="DODAAC" type="string_noCase" >
<cfgridcolumn name="DAGRSN" italic="yes" display="yes" header="DAGRSN">
<cfgridcolumn name="sDATE" display="yes" header="Date" mask="EEE DD-MMM-YY H:NN A">
<cfgridcolumn name="clin" width="35" display="yes" >
</cfgrid>
</cfform><cfargument name="gridsortdirection" required="true">
<cfset var selectAll = "">
<!--- this 'var' scopes the selectAll variable to be local to this function --->
<cfquery name="selectAll" datasource="#dsn#" dbtype="#i#">
Also, where are the 'dsn' and 'i' variables defined. They do not appear to be part of this function. Using a CFC function remotely has a great effect on what variables scopes may or may not be accessed.
Maybe you are looking for
-
How can I add a decimal in a string?
Hi, I try to make a function to insert a decimal point after the 3rd position in a string if length of that string is >= 4 I try as belows: If LENGTH(str) >= 4 THEN rdstr := SUBSTR(str, 3); ldstr := TRIM(TRAILING rdstr FROM str); str := CONCAT(CONCAT
-
IPhoto Shared iCloud Album Keeps Reappearing
On my Mac, I keep trying to delete a Photo Stream- I Ctrl+Click ->Delete Photo Stream, and for 2 seconds it is gone, then it is rebuilt. I can't figure out how to permanently delete it. I still want to keep sharing/photo stream on, for other photos,
-
When I want to listen to one of my play list (on shuffle or not) it always plays the same song over and over and does not go to the next song in the list. I tried re-initiating my ITouch but it has not solved the problem. I also downloadeded the 3.o
-
I am trying to run the command 'nitrogen home/dan/Pictures/Wallpapers/wallpaper1.jpg' to set my wallpaper, but this is the error that is being produced. I looked up Gtk, and figure it is gimp. So I downloaded gimp, but I am still receiving this sam
-
Ditributing Reports via e-mail
Following various Oracle Documents and Tutorials I have created some reports and have now been trying to get them distributed via e-mail. I can display them to screen as web pages but am having problems with mail. I have Oracle 9iAS 9.0.2.3 (incl BI