Search Results

Search found 52 results on 3 pages for 'datagridcolumn'.

Page 1/3 | 1 2 3  | Next Page >

  • Flex DataGridColumn with array of objects as data provider

    - by rforte
    I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs: { foo:"something"} { bar:"hello"} { caca:"lorem"} The datagrid has 2 columns. The first column is the key and the second column is the value. Right now my grid looks like: My dataFormatter function makes sure that depending on the column (i.e. the dataField value) the correct key or value gets printed out. This works fine for displaying. However, as soon as I try and edit the value field it essentially adds a new value into the object with a key of '1'. For example, if I edit the {caca:"lorem"} object it will then contain the value {caca:"lorem",1:"new value"}. Is there any possible way I can set the DataGridColumn so that when I edit a value it will update the value associated with the key rather than inserting a new value? I've tried using a custom item editor but it still does the insert. It seems like I need to be able to update the 'dataField' with the actual key value but I'm not sure how to do that.

    Read the article

  • Validate DataGridColumn cell's individually

    - by Joshua Fox
    How can I validate the cells in a DataGridColumn individually? The validation is configured per-row. For example FIELD VALUE TYPE age 13 Integer height 13x3 Integer registered true Boolean temperature 98.G6 Float In this case, of course 13x3 and 98.G6 would be invalid. Writing a Validator is no problem, and I can grab the TYPE from the data provider object, but now do I get individual access to the GUI cells so I can give the Validator a source which is an individual cell, set the errorString on an individual cell.

    Read the article

  • WPF Hide DataGridColumn via a binding

    - by Greg R
    For some reason I can't hide WPF Toolkit's DataGridColumn. I am trying to do the following: <dg:DataGridTemplateColumn Header="Item Description" Visibility="{Binding IsReadOnly}"> <dg:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text="{Binding Path=ItemDescription}" /> </DataTemplate> </dg:DataGridTemplateColumn.CellTemplate> This doesn't work, since it's looking for a IsReadOnly property on the ItemSource (not a property of the current class). If add this as a property of the ItemSource class that implements INoifyPropertyChanged, it still doesn't hide the column. Is there a way around this? I want the column to hid when a button click changes IsReadOnly property. Assume IsReadOnly returns a Visibility value and is a dependency property I am completely stuck, I would really appreciate the help! Thanks a lot!

    Read the article

  • Setting the DataGridColumn's dataField based on XML node with the same name

    - by Rie Mino
    I am stuck. Given this XML: <matrix> <row> <column>0.51</column> <column>0.52</column> <column>0.53</column> <column>0.54</column> </row> <row> <column>0.61</column> <column>0.62</column> <column>0.63</column> <column>0.64</column> </row> I am trying to define a DataGrid such that the row nodes will represent new rows in the DataGrid and the column nodes will be used to auto-populate the DataGrid's columns. I am having a problem setting the dataField for each of the DataGridColumn ojects created. The DataGrid is created but the cell values for row 1 are all 0.51 and row 2 are 0.61. What am I doing wrong here?

    Read the article

  • flex actionscript Datagridcolumn array

    - by Jad
    Hi, We have an AIR app and using a datagrid. We want to store the dataGrid.columns array in mySQL DB through PHP. This is needed because the user can customise the column headers of the datagrid and his preference needs to be stored and shown to him on his next login. Using HTTPService, we tried sending the dataGrid.columns array as a string, as follows, var ht:HTTPService = new HTTPService(); ht.url = Config.getServerURL(); ht.method = URLRequestMethod.POST; ht.resultFormat = "text"; ht.request["action"] = "updateGrid"; ht.request["headercolumns"] = colsArray.toString(); The data is stord as comma separated array string in DB. When we retrieve it back, cannot seem to cast it back to the DatagridColumns and assign it. Please let me know. Regards Jada.

    Read the article

  • How to retrieve TextBlock from DataGridColumnHeader HeaderStyle in Silverlight

    - by Xin
    As in Silverlight I can't bind directly to a DataGridColumn's property, in order to dynamically change the text of the column header, I have to write the following code using HeaderStyle. <data:DataGridTextColumn.HeaderStyle> <Style TargetType="dataprimitives:DataGridColumnHeader"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="{Binding Resource.ClientName, Mode=OneWay}"/> </DataTemplate> </Setter.Value> </Setter> </Style> </data:DataGridTextColumn.HeaderStyle> </data:DataGridTextColumn> My problem is that now I need to get the Name of the TextBlock from grid.Columns[index]. Is there any way I can do this? I tired to use VisualTreeHelper but since DataGridColumn is not a FrameworkElement it will throw me an error... Any help would be greatly appreciated! Xin

    Read the article

  • WPF DataGrid ComboBox Column: Propagating Header Combobox throughout column...

    - by LostKaleb
    Hey there! Here's my question: I've got a Datagrid in WPF and I have a first column that is a DataGridComboBoxColumn. What I'd like to do is to have a header for that column also with a combobox: altering the header with propagate throughout the column. I can get this done visually, but when I submit the data, the list that is bound with the Datagrid does not carry the new combobox values. <dg:DataGridComboBoxColumn SelectedItemBinding="{Binding BIBStatus}" ItemsSource="{Binding Source={StaticResource typeStatus}}" Width="0.20*"> <dg:DataGridComboBoxColumn.HeaderTemplate> <DataTemplate> <StackPanel> <TextBlock Text="Built-In Bridge"/> <ComboBox SelectedItem="{Binding BIBStatus}" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding Source={StaticResource typeStatus}}"/> </StackPanel> </DataTemplate> </dg:DataGridComboBoxColumn.HeaderTemplate> </dg:DataGridComboBoxColumn> In the ComboBox_SelectionChanged I have the following code: DataGridColumn comboCol = this.gridResults.Columns[0]; for (int i = 0; i < this.gridResults.Items.Count; i++) { ComboBox myCmBox = (comboCol.GetCellContent(this.gridResults.Items[i]) as ComboBox); myCmBox.SelectedValue = ((ComboBox)sender).SelectedValue; } When I submit the data, I submit the list that is DataContext to the Datagrid; if I change the value of the first column addressing a row at a time, i.e. clicking the cell with the combobox in each row, the values are propagated to the list in DataContext, however if I change the value of the first column by the header it does not. Can anyone tell me what I'm missing? I'm guessing it's the way I affect each row, but I've tried SelectedValue, SelectedItem and SelectedIndex... all to no avail. Thanks in advance...

    Read the article

  • I created a custom (WPF) DataGridBoundColumn and get unexpected behaviour, what am I missing?

    - by aspic
    Hi, I am using a DataGrid (from Microsoft.Windows.Controls.DataGrid) to display items on and on this DataGrid I use a custom Column which extends DataGridBoundColumn. I have bound an ObservableCollection to the ItemSource of the DataGrid. Conversation is one of my own custom datatypes which a (among other things) has a boolean called active. I bound this boolean to the DataGrid as follows: DataGridActiveImageColumn test = new DataGridActiveImageColumn(); test.Header = "Active"; Binding binding1 = new Binding("Active"); test.Binding = binding1; ConversationsDataGrid.Columns.Add(test); My custom DataGridBoundColumn DataGridActiveImageColumn overrides the GenerateElement method to let it return an Image depending on whether the conversation it is called for is active or not. The code for this is: namespace Microsoft.Windows.Controls { class DataGridActiveImageColumn : DataGridBoundColumn { protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem) { // Create Image Element Image myImage = new Image(); myImage.Width = 10; bool active=false; if (dataItem is Conversation) { Conversation c = (Conversation)dataItem; active = c.Active; } BitmapImage myBitmapImage = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block myBitmapImage.BeginInit(); if (active) { myBitmapImage.UriSource = new Uri(@"images\active.png", UriKind.Relative); } else { myBitmapImage.UriSource = new Uri(@"images\inactive.png", UriKind.Relative); } // To save significant application memory, set the DecodePixelWidth or // DecodePixelHeight of the BitmapImage value of the image source to the desired // height or width of the rendered image. If you don't do this, the application will // cache the image as though it were rendered as its normal size rather then just // the size that is displayed. // Note: In order to preserve aspect ratio, set DecodePixelWidth // or DecodePixelHeight but not both. myBitmapImage.DecodePixelWidth = 10; myBitmapImage.EndInit(); myImage.Source = myBitmapImage; return myImage; } protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem) { throw new NotImplementedException(); } } } All this works as expected, and when during the running of the program the active boolean of conversations changes, this is automatically updated in the DataGrid. However: When there are more entries on the DataGrid then fit at any one time (and vertical scrollbars are added) the behavior with respect to the column for all the conversations is strange. The conversations that are initially loaded are correct, but when I use the scrollbar of the DataGrid conversations that enter the view seems to have a random status (although more inactive than active ones, which corresponds to the actual ratio). When I scroll back up, the active images of the Conversations initially shown (before scrolling) are not correct anymore as well. When I replace my custom DataGridBoundColumn class with (for instance) DataGridCheckBoxColumn it works as intended so my extension of the DataGridBoundColumn class must be incomplete. Personally I think it has something to do with the following: From the MSDN page on the GenerateElement method (http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridcolumn.generateelement%28VS.95%29.aspx): Return Value Type: System.Windows. FrameworkElement A new, read-only element that is bound to the column's Binding property value. I do return a new element (the image) but it is not bound to anything. I am not quite sure what I should do. Should I bind the Image to something? To what exactly? And why? (I have been experimenting, but was unsuccessful thus far, hence this post) Thanks in advance.

    Read the article

  • "freeze" one column in flex datagrid

    - by Bob Spidell
    I'm using a datagrid to display a column of date ranges and several columns of data. I'd like to make the first column (the date ranges) fixed; i.e. that column stays in place when the user scrolls the other columns. That way, the dates column will always be visible as the user scrolls through many data columns. I don't see a datagrid property for this; anyone have a solution? TIA

    Read the article

  • Adapting the width of a Flexs 3 DataGridColumn to the content of its ItemRenderer ?

    - by phtrivier
    I have the following scenario : A Flex 3 DataGrid is sitting here At runtime, a column is added to this grid The column has a custom ItemRenderer The ItemRenderer inherits from HBox, and adds a few items to the HBOx dynamically My problem is that the width of the column doesn't change. As a consequence, my column stays small, and an ugly horizontal scrollbar is displayed in the line, instead of my content (which is completely unreadable). I would like the column to adapt its width to the content of the HBox in the ItemRenderer. I tried the following : Setting the 'percentWidth' of the ItemRenderer to '100' Invalidating the properties of the ItemRenderer after adding the items The only thing that has a "visible" effect it to force the width of the DataGridColumn. Obviously this is not acceptable since I'm dynamically adding components to the ItemRenderer, and I don't know how many or how big they are. Besides, when I am in the ItemRenderer, I have no access to the column itself (or do I ?) so I cannot force the size of the column from here. So is there a way around this ? Would AdvancedDataGrid help here (notwhistanding the fact that I cannot really use it for other reasons ...) Thanks PH

    Read the article

  • How can I bind Wpf DataGridColumn to an object?

    - by John
    I want to bind the columns of my WPF DataGrid to some objects in a Dictionary like this: Binding Path=Objects[i] where Objects is my Dictionary of objects, so that each cell will represent an Object element. How can I do that? I suppose that I need to create a template for my cell, which I did, but how to get the result of column binding in my template? I know that by default the content of a DataGridCell is a TextBlock and it's Text property is set through column binding result, but if that result is an object I guess that I have to create a ContentTemplate. How do I do that, as the stuff I tried is not displaying anything. Here it is what I tried: <Style x:Key="CellStyle" TargetType="{x:Type dg:DataGridCell}"> <Setter Property="Template"> ---it should realy be ContentTemplate? <Setter.Value> <ControlTemplate> <controls:DataGridCellControl CurrentObject="{Binding }"/> -- I would expect to get the object like this for this column path : Path=Objects[i] but is not working </ControlTemplate> </Setter.Value> </Setter> </Style> So, to make myself completly clear, i want to get in CurrentObject property of my DataGridCellControl the current object that should result if I set the column binding in my data grid like this Path=Objects[i]. Thank you for any suggestion, John.

    Read the article

  • How can I know when a Button in a Flex DataGrid itemRenderer is clicked?

    - by Eric Belair
    I have a DataGrid component that displays a few columns of data. It has one additional column that displays a Button that allows the user to take an action with regard to the record. <mx:DataGrid dataProvider="{myData}"> <mx:columns> <mx:DataGridColumn dataField="firstName" headerText="First Name" width="75" /> <mx:DataGridColumn dataField="LastName" headerText=" Last Name" width="150" /> <mx:DataGridColumn dataField="phone" headerText="Phone" width="120" /> <mx:DataGridColumn headerText="" width="110"> <mx:itemRenderer> <mx:Component> <mx:Box horizontalAlign="center" width="100%"> <mx:Button label="Take Action" /> </mx:Box> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid> I need to perform an action in the parent component, using other data that is available there, but unrelated to the data in the DataGrid. What is the best way to catch the Button click in the parent component, and know what record it corresponds to? Should I use a Custom Event, or an itemEditor, or something else completely?

    Read the article

  • One DataGrid Item Renderer for multiple columns

    - by user329650
    Hey, I'm trying to create a Flex DataGrid where the firstname and lastname are shown under each other, but in the DataGridColumn Ideally I would want to do something like <mx:columns> <mx:DataGridColumn headerText="Column 2" dataField="time"/> <mx:DataGridColumn headerText="Column 2" dataField="firstname,lastname" itemRenderer="renderers.FirstNameLastName"/> so that both values get passed to the itemrenderer, is this possible? Dennis

    Read the article

  • Checkbox rendering in datagrid

    - by Thirst for Excellence
    <mx:DataGrid id="dg" dataProvider="{cNumbersList}"> <mx:columns> <mx:DataGridColumn dataField="contactName" headerText="Name" width="50"/> <mx:DataGridColumn dataField="contactNo" headerText="ContactNo" width="40"/> <mx:DataGridColumn headerText="Select Contact Number" width="20"> <mx:itemRenderer> <mx:Component>enter code here <mx:CheckBox selected="false" /> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid> How to get all checked items into one more new array ?Plz help me anyone

    Read the article

  • How to get selected items Drag & drop component ?

    - by Thirst for Excellence
    How to get all the selected items from in this below code selectedContsList ? <mx:DataGrid id="dg" dataProvider="{cNumbersList}" allowMultipleSelection="true" dropEnabled="true" dragMoveEnabled="true" > <mx:columns> <mx:DataGridColumn dataField="contactName" headerText="Name"/> <mx:DataGridColumn dataField="contactNo" eaderText="ContactNo"/> </mx:columns> <mx:Label text="Selected Contacts :" width="122" color="#C90855" height="16"/> <mx:DataGrid id="selectedContsList" allowMultipleSelection="true" dragMoveEnabled="true" dragEnabled="true" > <mx:columns> <mx:DataGridColumn dataField="contactName" headerText="Name"/> <mx:DataGridColumn dataField="contactNo" headerText="ContactNo"/> </mx:columns> </mx:DataGrid>

    Read the article

  • Flex ItemRenderer/Editor ComboBox Issue...Puhleezz Help

    - by Mohit
    Hi EveryOne Beginner in Flex ...Even worse with item renderers... Have managed to add a Combobox to a datagrid using a itemEditor... I want to change the options in a combo box depending on the value selected by the user on a previous combo.. In the combo box i want to display a certain value (Model Name ) but for quering a table i'll pass the corresponding code of the model :(... sounds simple enough ..unfortunately not able to implement it I have found this problem on this site but the solution seems an overkill for my "small" problem..was hoping if anyone could guide me towards a more simpler solution... My xml comes as <item><mstValue>CH1</mstValue><mstRemarks>CARRIER</mstRemarks></item> <item><mstValue>CH2</mstValue><mstRemarks>TRANS</mstRemarks></item> <item><mstValue>CH3</mstValue><mstRemarks>YORK</mstRemarks></item> Now i have been able to show the values in a combo .if user selects CARRIER i want to pass CH1(dont know how to do it with itemeditors)...and then fetch values corresponding to CH1 from a table (second part of the problem)...in the sample below i used this.parentDocument.modelComboChanged(this.selectedItem) to pass the selected value ...instedd i need to pass the code for it which comes from the xml...Pls help this making me go crazy.... <mx:DataGrid id="chillerGrid" dataProvider="{chillerGridDp}" editable="true" itemRollOver="{ComponentUtil.setTooltip(event,this)}" itemRollOut="ComponentUtil.resetTooltip(event)" width="70%" height="160"> <mx:columns> <mx:DataGridColumn id="test" headerText="Model" dataField="model" editorDataField="value" editable="true" backgroundColor="#f4f2bd" width="100" > <mx:itemEditor> <mx:Component> <mx:ComboBox creationComplete="{if(text=='')selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();}" change="{if(text == ''){selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();};this.parentDocument.modelComboChanged(this.selectedItem)}" dataProvider="{this.parentDocument.arrColl1}" text="mstRemarks" labelField="mstRemarks" editable = "false" > <!--<mx:dataProvider > <mx:String></mx:String> <mx:String>Model1</mx:String> <mx:String>Model2</mx:String> <mx:String>Model3</mx:String> <mx:String>Model4</mx:String> <mx:String>Model5</mx:String> </mx:dataProvider>--> </mx:ComboBox> <!--<components:ComboBoxIn dataProvider="{this.parentDocument.arrColl1}" labelField="mstRemarks" /> --> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> <mx:DataGridColumn headerText="Make" dataField="make" editorDataField="value" editable="true" backgroundColor="#f4f2bd" width="100" > <mx:itemEditor> <mx:Component> <mx:ComboBox creationComplete="{if(text=='')selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();}" change="{if(text == ''){selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();} }" labelField="@label" editable = "false" > <mx:dataProvider> <mx:String></mx:String> <mx:String>Carrier</mx:String> <mx:String>York</mx:String> <mx:String>Trane</mx:String> </mx:dataProvider> </mx:ComboBox> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> <mx:DataGridColumn headerText="Chillers" dataField="chillers" width="200" editable="true"> <mx:itemEditor> <mx:Component> <mx:TextInput maxChars="49" /> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>

    Read the article

  • Flex Datagrid File Download old value

    - by Vish
    Hi, We use a AIR client and WAMP server. Got a weird issue with Flex datagrid. When I download an image by double clicking on a datagrid row, the file gets downloaded correctly. But when I go on to select another row for download, even though the correct parameters are being passed, it again prompts download of old file. Upon cancelling that and trying again, it picks up the selected row. Not sure how to fix this issue, below is the datagrid code I am using, <mx:DataGrid x="10" y="10" id="ourDataGrid" visible="true" enabled="true" dataProvider="{fileList}" verticalScrollPolicy="on" selectionColor="#B7C6E7" itemClick="downloadFile(event)"> <mx:columns> <mx:DataGridColumn headerText="Name" dataField="@name" /> <mx:DataGridColumn headerText="LastName" dataField="@lastname" /> <mx:DataGridColumn headerText="FirstName" dataField="@firstname" /> </mx:columns> </mx:DataGrid>

    Read the article

  • How can i show delete image in each row in a Data grid ?

    - by developer
    i want show a image onmouse over inside data grid to each row,so if i click on that image,some function should call(as per my requirement). how can i do this ? <mx:DataGrid width="320" height="624" verticalScrollPolicy="on" dataProvider="{blocked_Usernames}" editable="true"> <mx:columns> <mx:DataGridColumn headerText="Blocked User Name" dataField="blockedUsernames" editorDataField="value"/> <mx:DataGridColumn width="20" editable="false"> <mx:itemRenderer > <mx:Component > <mx:Image source="@Embed('assets/image/Close.png')" width="10" height="10" autoLoad="false"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>

    Read the article

  • Accessing an ItemRenderer in a DataGrid

    - by mmattax
    I have a data grid that has a checkbox item renderer in a cloumn to allow row selections: Main application: <mx:DataGrid id="dg" <mx:columns <mx:DataGridColumn id="ir" itemRenderer="renderers.RowCheckbox" / <mx:DataGridColumn dataField="Name" headerText="Name" / </mx:columns </mx:DataGrid Item renderer: <-- RowCheckbox -- <?xml version="1.0" encoding="utf-8"? <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" <mx:CheckBox id="chk"/ </mx:HBox How can I get a handle to the item renderer / checkbox so that I may determine which rows are checked?

    Read the article

  • dynamic Grid columns

    - by stck777
    Hi, I need help with dynamic columns in a DataGrid. I use GenericFrame front-end with PHP backend. If I use static columns like this: <? ... ?> <DataGrid id="DataGrid1" width="100%"> <columns> <DataGridColumn headerText="name" dataField="@username" width="150"/> <DataGridColumn headerText="Nahcname" dataField="@secondname" width="150"/> <DataGridColumn headerText="alter" dataField="@age" width="40"/> </columns> </DataGrid> <? ... ?> It is working fine. But I try to create the columns dynamic with PHP. <generic> <template target="gridbox"> <VBox id="dynamic" height="100%"> <!-- DataGrid --> <DataGrid id="DataGrid1" width="100%" > <columns> <?php $columns = array( //Spalte => (Breite, Datenfeld) "name" => array(150,"@username"), "Nahcname" => array(150,"@secondname"), "alter"=> array(40,"@age") ); foreach ($columns as $key => $value) { ?> <DataGridColumn headerText="<? echo $key; ?>" dataField="<? echo $value[0]; ?>" width="<? echo $value[0];?>"/> <?php } ?> </columns> </DataGrid> <Binding source="templatedata.data1.item" destination="DataGrid1.dataProvider" /> </VBox> </template> <templatedata> <data1> <!-- Daten --> <item username="User1" secondname="Nachname1" age="22"/> <item username="User2" secondname="Nachname2" age="25"/> <item username="User3" secondname="Nachname3" age="27"/> <item username="User4" secondname="Nachname4" age="32"/> </data1> </templatedata> The DataGrid is displayed correctly, but without data? any idea why?

    Read the article

  • How to correct the objection about dymanic Object type by FlexPMD?

    - by sanjoy roy
    I have the code in one of my flex file used as labelFunction in a DataGrid. When I run the FlexPMD to do the code review , it generates objection about the dynamic type object used in method signature "public function getFormattedCreatedTime(item:Object, column:DataGridColumn):String", it suggests to use strongly type object. Does anyone how to rectify it? public function getFormattedCreatedTime(item:Object, column:DataGridColumn):String { var value:Date=item[column.dataField]; return dateFormatter.format(value); } ]] Thanks

    Read the article

  • WPF DataGrid window resize does not resize DataGridColumns

    - by skylap
    I have a WPF DataGrid (from the WPFToolkit package) like the following in my application. <Controls:DataGrid> <Controls:DataGrid.Columns> <Controls:DataGridTextColumn Width="1*" Binding="{Binding Path=Column1}" Header="Column 1" /> <Controls:DataGridTextColumn Width="1*" Binding="{Binding Path=Column2}" Header="Column 2" /> <Controls:DataGridTextColumn Width="1*" Binding="{Binding Path=Column3}" Header="Column 3" /> </Controls:DataGrid.Columns> </Controls:DataGrid> The column width should be automatically adjusted such that all three columns fill the width of the grid, so I set Width="1*" on every column. I encountered two problems with this approach. When the ItemsSource of the DataGrid is null or an empty List, the columns won't size to fit the width of the grid but have a fixed width of about 20 pixel. Please see the following picture: http://img169.imageshack.us/img169/3139/initialcolumnwidth.png When I maximize the application window, the columns won't adapt their size but keep their initial size. See the following picture: http://img88.imageshack.us/img88/9362/columnwidthaftermaximiz.png When I resize the application window with the mouse, the columns won't resize. I was able to solve problem #3 by deriving a sub class from DataGrid and override the DataGrid's OnRenderSizeChanged method as follows. protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) { base.OnRenderSizeChanged(sizeInfo); foreach (var column in Columns) { var tmp = column.GetValue(DataGridColumn.WidthProperty); column.ClearValue(DataGridColumn.WidthProperty); column.SetValue(DataGridColumn.WidthProperty, tmp); } } Unfortunately this does not solve problems #1 and #2. How can I get rid of them?

    Read the article

  • How to get the value of a ComboBox within a DataGrid

    - by Jason Towne
    While this may be a simple problem, I'm having a heck of a time coming up with a solution. I have a DataGrid with a ComboBox as an ItemRenderer for one of my columns. When the user selects a row, I want to get the ComboBox's selected value for the selected row. Any suggestions? Some sample code: <mx:DataGrid id="myGrid" dataProvider="{myData}"> <mx:columns> <mx:DataGridColumn headerText="Column 1" dataField="dataField1" /> <mx:DataGridColumn headerText="Column 2" dataField="dataField2_Array"> <mx:itemRenderer> <mx:Component> <mx:HBox paddingLeft="5"> <mx:ComboBox id="myComboBox" dataProvider="{data.dataField2_Array}" /> </mx:HBox> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>

    Read the article

  • Adobe Flex Datagrid: addEventListener MouseEvent.CLICK

    - by JonoB
    I have a datagrid with a custom label itemrenderer (basically it makes the label look like a traditional html hyperlink). <mx:DataGridColumn id="itemId"> <mx:itemRenderer> <mx:Component> <controls3:HyperlinkLabel text="{data.doc}" /> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> The above works perfectly. I'd like to try add an event listener to this itemrenderer, but I'm not sure how to do this given that I cant specify an id for the itemrendered itself. I tried the following, but it doesnt seem to work: itemId.addEventListener(MouseEvent.CLICK, onItemSelect);

    Read the article

  • Adding a sortcomparefunction to Dynamic Data Grid in flex

    - by Tom
    Hi, I am trying to create a dynamic datagrid in Flex 3, I have a list of columns a list of objects which correspond to datapoints for those columns which I fetch from a url. While the grid works perfectly fine the problem is that sorting on the columns is done in lexical order. I am aware that this can be fixed by adding a sortcomparefunction to a column, which is not easy for this case. I have tried doing var dgc:DataGridColumn = new DataGridColumn(dtf); f1[dtf] = function(obj1:Object, obj2:Object):int { return Comparators.sortNumeric(obj1[dtf],obj2[dtf]); }; dgc.sortCompareFunction = f1[dtf];` But the problem is that the function object that I am creating here is being overwritten in every iteration (as I am adding columns) and eventually all the columns will have sorting done only on the last column added. Suggestions please.

    Read the article

1 2 3  | Next Page >