Draw gradient datagrid cells

Hi
How can I draw a gradient backround in a datagrid cell using
a class that expends a DataGridItemRenderer Class ?
Thanks,
Aubry

"bujj_xyz" <[email protected]> wrote in
message
news:g9qqms$goo$[email protected]..
> hi,
>
> you told advanced datagrid but i can use only datagrid,
for advanced
> datagrid
> there is background message...thats why
>
> if u don't mine can u give me any example i need very
urgent.
You can get rid of the message by upgrading to pro.

Similar Messages

  • How to enter a value into datagrid cell in wpf through manually?

    Hi,
        Here my datagrid rows are in readonly mode here how can i enter the values in to the datagrid cell.(means how can i edit the cell value).i am adding the value to datagrid through programetically, I think  for this reason my datagrid rows
    are visible in readonly mode. Then how can i edit. Please guide me.
    Regards,
    Bhadram

    Hi Barry,
       Thank you for your reply, Now i sending my sample please check it once and suggest me.
    MainWindow.xaml.cs
    private void Save_Click(object sender, RoutedEventArgs e)
     List<CustomerMainViewModel> customer = new List<CustomerMainViewModel>(); customerviewmodel.NameTextField = tbName.Text;
    customerviewmodel.AddressTextField = tbAddress.Text;
    customerviewmodel.CountryField = countryddl.Text;
    customerviewmodel.StateField = stateddl.Text;
    customerviewmodel.Product = customerviewmodel.Product1 + "," + customerviewmodel.Product2;
    foreach(string str in customerviewmodel.actionCollection)
    customerviewmodel.ActionColl.Add(str);
    customerviewmodel.actionCollection.Clear();
    customer.Add(customerviewmodel);
    dataGrid1.Items.Add(customer);
    MessageBox.Show("Data Successfully Saved", " MessageBox", MessageBoxButton.OK, MessageBoxImage.Asterisk);
    clearValues();
    MainWindow.xaml
    <DataGrid
    Height="144"
    HorizontalAlignment="Left"
    Margin="79,447,0,0"
    Name="dataGrid1"
    VerticalAlignment="Top" CanUserAddRows="True"
    Width="399" Grid.RowSpan="2" IsReadOnly="False">
    <DataGrid.Columns>
    <DataGridTextColumn Header="NAME" Binding="{Binding NameTextField,Mode=TwoWay}" Width="Auto" IsReadOnly="False" />
    <DataGridTextColumn Header="ADDRESS" Binding="{Binding AddressTextField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
    <DataGridTextColumn Header="GENDER" Binding="{Binding GenderField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
    <DataGridTextColumn Header="COUNTRY" Binding="{Binding CountryField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
    <DataGridTextColumn Header="STATE" Binding="{Binding StateField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
    <DataGridTextColumn Header="PRODUCT" Binding="{Binding Product,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
    <DataGridTemplateColumn Header="ACTION" MinWidth="140" IsReadOnly="False">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <ComboBox x:Name="actionddl" ItemsSource="{Binding ActionColl}"/>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    </DataGrid.Columns>
    </DataGrid>
    In the above "xaml" file i am using the attribute "Readonly="False"" but its not effected on my code still my datagrid is in readonly mode, i don't know why it happens. 
    And I am adding data to my datagrid through "Wpf controls (TextBox,CheckBox,ComboBox and etc...)"  while click on "save" button the data added to grid. adding to grid works properly but the entire row is in readonly mode. How can
    i solve my problem.  

  • Help needed to add an image to a datagrid cell in actionscript

    Morning all,
    I am still quite new to flex development and I have an application which uses xml to populate a datagrid. One of the row columns should display a small image but I don't know how to do that.
    Can anyone show me how to add an image to a datagrid cell in actionscript?
    I've added a sample of the code I have written already below. Any help would be much appreciated.
    Thanks in advance,
    Xander
    My XM
    <?xml version="1.0" encoding="UTF-8"?>
    <dataset>
    <modules>
    <module id="1">
    <icon>assets/sample_image1.png</icon>
    <key>core</key>
    <name>Core</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 15:59 UK</installed>
    </module>
    <module id="2">
    <icon>assets/sample_image2.png</icon>
    <key>webproject</key>
    <name>Web Project</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 17:32 UK</installed>
    </module>
    </modules>
    </dataset>
    My Actionscript
    private function dataSetHandler(event:Event):void {
        var ds:XML = new XML(event.target.data);
        var rows:XMLList = ds.elements('modules').elements('module') as XMLList;
        var columns:Array = new Array();
        for (var i:int=0; i<rows[0].elements().length(); i++) {
            var column:DataGridColumn = new DataGridColumn();
            var tag:String = rows.*[i].name();
            column.headerText = rows.*[i].name();
            column.dataField = rows.*[i].name();
            if (tag == 'icon') {
                var img:Image = new Image();
                img.id = "iconpath";
                img.width = 23;
                img.height = 20;
                img.source = rows.*[i].name();
               column.itemRenderer = img;   <-- this line shows as an error when I try to compile
            columns[i] = column;
        mydatagrid.columns = columns;
        mydatagrid.dataProvider = rows;

    you cant just set image object to itemrenderer, you need to use classfactory.
    http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_4.html

  • How to change content of DataGrid cell on mouse over

    I am trying to change content of a datagrid cell when the mouse is over it. Changing the dataProvider does not provide immediate feedback because update is performed by renderer. I am trying to directly update content of a cell onMouseOver and restore it onMouseOut.
    I am thinking of leaving the column empty and insert content onMouseOver, cleanup onMouseOut. Alternative, may be I can populate the column and mask out all but the cell the mouse is over.
    Any suggestion on how this may be done?
    Thanks!

    I would override updateDisplayList, call isItemHighlighted and set the content of the cell accordingly
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Moive clip in dataGrid cell.

    I want to put a movie clip into datagrid cell
    and cell data will change the color of the movie clip.
    how could I do that?
    pls help

    I think, you can use cellRenderer.
    If you want add icon something like that means, you can use
    "setPropertiesAt"

  • Combobox behavior inside a datagrid cell

    How do you control the width of a combobox that resides
    inside a datagrid cell? Merely setting cb.dropdownWidth = "some
    value" does not work.

    ok.. i got it. You can successfully modify
    dropdownWidth from withing your CellRenderer class using the 'open'
    event.

  • Enlarging a Flex DataGrid cell on RollOver

    Hi, I have a DataGrid which has a column named Hyperlinks where I show useful hyperlinks for the user. Sincce typically Hyperlinks are too big to show in a DataGrid cell, I need to have the column width at max 100px to be able to fit other columns in the Grid.
    What I am looking for is a way to show content of the cell when the user mouse over the cell. May be when user rollover, the cell shows the content increasing its size overlapping on the adjucent cells.
    Can anyone pls give me some suggestion on this? a code snippet would be very helpful if possible...
    Thanks in advance, Bose.

    Hi
    Instead of enlarging a cell you can display data using showDataTips="true" for the respective column.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955" minHeight="600" applicationComplete="initData()">
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                private var DGArray:Array = [
                    {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
                    {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99}];
                [Bindable]
                public var initDG:ArrayCollection;
                public function initData():void {
                    initDG=new ArrayCollection(DGArray);
            ]]>
        </fx:Script>
        <mx:DataGrid id="myGrid" dataProvider="{initDG}" >
            <mx:columns>
                <mx:DataGridColumn dataField="Album" dataTipField="Album" showDataTips="true" />
                <mx:DataGridColumn dataField="Price" />
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>

  • Adding MovieClip to DataGrid Cell

    Hi to all..
    I have added components like ComboBox, CheckBox etc in the
    DataGrid cell..
    But Now I want to add MovieClip If not possible then Swf in
    the DataGrid cell using cellrenderer.
    Is it possible to add such things.
    If yes can you guide me how..? I have spend 3 days after
    this... Please Help me out..
    Thanks.

    quote:
    Hi...
    I'm using AS3.
    By the way I have added Movieclip on the data grid cell...
    But now the problem is how to make it editable because I have
    added two components on the same cell...
    And that cell take this both component as object and you can
    not edit that object by just making that column as editable =
    true... so if any one can suggest me the way..
    the help will be appreciated......

  • Displaying different data in datagrid cells using a cellrenderer?

    Gidday guys
    I'm populating a datagrid using SQLite. Some SQL columns contain 1 or 0 as booleans, and I want to display this as a bullet point in my datagrid.
    Currently I have a conditional that checks for a 1, and if found, displays the bullet point. I figure there must be a better way, but am unsure how to do this with cellrenderers. I get how to add components using cellrenderers, but is there a way to replace the cell display with another character (without actually changing the data of the dataprovider) ?
    Cheers for taking a look.

    It would be better performance to draw a simple shape rather than a TextField with a single character in it. To do so, yes you'd need to override the cell renderer. I often choose the latter but usually use GPU-driven components like FeathersUI components.
    If you have an excessively large amount of data and/or are on a device and want to do this because you're getting poor performance, that's a good usage of your time. Also if you just want to learn how to do it just to do it, that's can also be a good usage, if you complete your work on time. However if it's for desktop and/or the data is pretty minimal (few dozen rows up to a hundred or so, with a nominal amount of columns), it's probably not worth your time.
    I'm sure you have this link but:
    http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d1 18a9c65b32-7fd4.html
    All component cellrenderers tend to be the same (because larger components use smaller components and the architecture lines up). The difference is in making sure your renderer supports the data it's provided. If you need only a TextField and/or a bullet, that's pretty easy. Most components (like lists) support icons and you'll need to make sure you provide the complete implementation of all data scenarios in your cellrenderer.
    Pay attention to cell dequeue techniques on some components. If all cells commonly have only text, cells aren't destroyed and recreated as the list scrolls. The data is resent to the cell and the cell has a chance to simply update itself rather than recreate itself from scratch. This offers a big performance increase not having to destroy and recreate needlessly. It can also really confuse people when cells start appearing empty as you scroll (because the cell construction methods aren't run). 

  • How do you programmatically change an image in DataGrid cell

    I have a DataGrid which contains a status icon. I have been able to get the initial status icon to show in the DataGrid. But I am unable to update the it. I basically need to update the image for a selected row with either a 'assets/processing.png',  'assets/success.png' or 'assets/failure.png' image. I just cannot seem to be able to figure out how to get access to the image in the necessary cell to update/replace it. I've tried to make it a property of my ArrayCollection data provider, but that does not work. I've also have tried to some how get a reference to the original image so it can be replaced, but cannot figure out how to do such. Below is the code to my DataGrid. I will be very appreciative of any help on this. (I'm relatively new to Flex/ActionScript, but a seasoned developer otherwise.)
    <mx:DataGrid id="myDataGrid" left="0" top="0" bottom="0" right="0"
                         allowMultipleSelection="true" verticalScrollPolicy="on"
                         draggableColumns="false" resizableColumns="false" sortableColumns="false"
                         dataProvider="{myArrayCollection}">
                <mx:columns>
                    <mx:DataGridColumn headerText="Name" dataField="name" wordWrap="true" />
                    <mx:DataGridColumn headerText="Status" dataField="status" width="75" textAlign="center">
                        <mx:itemRenderer>
                            <mx:Component id="statusComponent">
                                <mx:HBox id="imageBox" width="100%" height="100%" horizontalAlign="center">
                                    <mx:Image id="statusImage" source="@Embed('assets/pending.png')" width="16" height="16"  />
                                </mx:HBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>
                </mx:columns>
            </mx:DataGrid>

    Mark,
    My sincerest thanks for your assistance. myDataGrid.invalidateList() the key thing I was missing in all my previous attempts. I had thought about  needing to do something to refresh the grid, but was looking for a "refresh" method. I did not see the invalidateList() method.
    To get it to work I needed to override the Container's set data method within the status image column (see below for my full example). Without this, it does not work. Am I missing something or is there a better way to do this?
    Again, thank you very much for your help.
    <?xml version="1.0" ?>
    <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
      <mx:Canvas width="100%" height="100%">
        <mx:DataGrid id="myDataGrid" left="0" top="0" bottom="0" right="0"
                     allowMultipleSelection="true" verticalScrollPolicy="on"
                     draggableColumns="false" resizableColumns="false" sortableColumns="false"
                     dataProvider="{myArrayCollection}">
          <mx:columns>
            <mx:DataGridColumn headerText="Name" dataField="name" wordWrap="true" />
            <mx:DataGridColumn headerText="Status" dataField="status" width="75" textAlign="center">
              <mx:itemRenderer>
                <mx:Component>
                  <mx:HBox width="100%" height="100%" horizontalAlign="center">
                    <mx:Image id="statusImage" width="16" height="16" />
                    <mx:Script>
                      <![CDATA[
                      override public function set data(value:Object):void
                        if (value != null)
                          statusImage.source = value.status;
                      ]]>
                    </mx:Script>
                  </mx:HBox>
                </mx:Component>
              </mx:itemRenderer>
            </mx:DataGridColumn>
          </mx:columns>
        </mx:DataGrid>
      </mx:Canvas>
      <mx:Button id="updateButton" click="updateIcon()" label="Update Icon" />
      <mx:Script>
      <![CDATA[
        import mx.collections.ArrayCollection;
        [Embed(source="assets/success.png")]
        public static const successImage:Class;
        [Embed(source="assets/fail.png")]
        public static const failImage:Class;
        [Embed(source="assets/pending.png")]
        public static const pendingImage:Class;
        [Bindable]
        private var myArrayCollection:ArrayCollection = new ArrayCollection();
        private var lastIndex:Number = 0;
        private function updateIcon():void
          //sample updating
          var item:Object = myArrayCollection.getItemAt(lastIndex);
          (lastIndex % 2 == 0) ? item.status = EmbeddedImages.successImage : item.status = EmbeddedImages.fail1Image;
          myDataGrid.invalidateList();
          if (++lastIndex > myArrayCollection.length - 1)
            lastIndex = 0;
        private function init():void
          //load some dummy sample data for demo/testing
          for (var i:Number = 1; i <= 10; i++)
            myArrayCollection.addItem({
              name:"value-" + i,
              status:pendingImage
        ]]>
        </mx:Script>
    </mx:Panel>

  • Double click on Datagrid cell

    Hi,
    I'm developing an application where I'm using a datagrid that shows some information from an xml. Every cell in the grid is of the form
    <itemRenderer>
    <compoment>
    <Vbox>
    <HBox>
    <Text/> //some text goes within this block
    <Text/> //some text goes within this block
    <Text/> //some text goes within this block
    </Hbox>
    </VBox>
    </component>
    </itemRenderer>
    I have set a function call for the datagrid on ItemDoubleClick event; and this even gets triggered only when i double click on any TEXT that is on the cell; and NOT on any part of the cell. However, I would like to have this triggered when the user clicks anywhere in the cell.
    Sombody please help,
    Thanks!!

    Hi,
    Thanks for the suggestion. Maybe I wasn't clear in explaining the issue here. Let me throw some light now, My code is somewhat like this
    <mx:VBox opaqueBackground="{myxml.@data>10 ?  '0xA2FEA2' : '0xFEA2A2' }" width="100%" height="100%" verticalScrollPolicy="off">
         <mx:Box width="100%" height="100%">
              <mx:Text id="txt1" text="Available" width="100%"/>
               <mx:Text id="txt2" text="{myxml.@data}"/>
         </mx:Box>
    </mx:VBox>
    The output is shown in the attachment. Now whenever I double click on the text in the datagrid(highlighted in blue in the attachment) my doubleclick even is fired; but if i click anywhere in the cell(green region in the attachment) my doubleclick event is not called.
    Hope this helps! Looking forward for your assistance,
    Thanks again!!
    Cheers

  • Can I draw within a cell in Numbers on iPad?

    Hello
    I haven't bought the app yet.  But an important feature for me for my work, would be the ability to draw (handwrite) within a cell in Numbers.
    Could anyone please tell me if this is possible?
    Many thanks.
    Gary

    No, you can't handwrite within a cell. All data entry is via keyboard interfaces.

  • Enable / disable combo box in datagrid cell

    I have a datagrid with 8 columns 2 check boxes a text box and
    5 combo boxes. I am trying to disable the combo boxes if the first
    check box is not checked. So far I am able to disable the entire
    column with the combo box in it, but what i am trying to achieve is
    if the check box is false then the 5 combo boxes are to be
    disabled.
    So what I am asking in a nutshell is is there a way to enable
    or disable particular cells in a datagrid ?
    Example
    of what I have already done
    Any suggestions will be gratefully received.

    I put the following code in that I took from samples:
    Bindable]public var test:ArrayCollection;
    private  
    function init():void
    test =
    new ArrayCollection([{label:"High", data:"high"},{label:
    "Medium", data:"medium"},{label:
    "Low", data:"low"}]) 
    Then in the mxml:
    <mx:DataGridColumn 
    headerText="From Fiscal Period">
    <mx:itemRenderer>
    <mx:Component>
    <mx:ComboBox dataProvider="{test}">
    </mx:ComboBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    I still get the same error: 1120: Access of undefined property test.

  • How do I copy and paste a drawing into a cell on a table?

    How do I copy a drawing (image) from one document and paste it into a table on another document?  I did do it and it looked good on the computer , saved the file and when I printed the drawing wasn't there.

    Sounds like you are not in Mountain Lion and have updated to Pages 5 on Mavericks.
    Images in cells ahs been removed by Apple along with over 90 other features in Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter

  • How make datagrid cell clicking not to affect the row selected?

    Hi all,
    I made SelectionUnit as FullRow. The first column, second column, and so on, which can work well for selecting row when I clicking the cells of them.
    But I want the last column to remove the affection that the whole row is selected when I click last column cell.
    how to do it? thanks.
    <DataGrid ItemsSource="{Binding itemSource}" AutoGenerateColumns="False" RowHeight="25" SelectionUnit="FullRow"

    You could set the AutogenerateColumns property to false, define all columns in the XAML markup explicitly and then specify a CellTemplate for the last column and handle its MouseLeftButtonDown event to change the SelectionUnit property of the DataGrid. Here
    is an example for you:
    <DataGrid x:Name="dg" AutoGenerateColumns="False" RowHeight="25" SelectionUnit="FullRow">
    <DataGrid.Resources>
    <Style TargetType="DataGridCell">
    <EventSetter Event="PreviewMouseLeftButtonDown" Handler="cell_MouseLeftButtonDown"/>
    </Style>
    </DataGrid.Resources>
    <DataGrid.Columns>
    <DataGridTextColumn Binding="{Binding A}"/>
    <DataGridTextColumn Binding="{Binding B}"/>
    <DataGridTextColumn Binding="{Binding C}">
    <DataGridTextColumn.CellStyle>
    <Style TargetType="DataGridCell">
    <EventSetter Event="PreviewMouseLeftButtonDown" Handler="cell_MouseLeftButtonDownLast"/>
    </Style>
    </DataGridTextColumn.CellStyle>
    </DataGridTextColumn>
    </DataGrid.Columns>
    </DataGrid>
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    List<MyItem> items = new List<MyItem>();
    items.Add(new MyItem() { A = "1", B = "1", C = "1" });
    items.Add(new MyItem() { A = "2", B = "2", C = "2" });
    dg.ItemsSource = items;
    void cell_MouseLeftButtonDownLast(object sender, MouseButtonEventArgs e)
    dg.SelectionUnit = DataGridSelectionUnit.Cell;
    void cell_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    dg.SelectionUnit = DataGridSelectionUnit.FullRow;
    Please remember to mark all helpful posts as answer to close the thread and then please start a new thread if you have a new question.

Maybe you are looking for