1 Reply Latest reply on Feb 22, 2007 7:15 AM by michael_ramirez44

    Formatting selected row in data grid

    nprzybylo
      I have a datagrid, and I'd like to set a row to bold that a user clicks on. How do I go about applying this format to a particular row? I believe it would be done in the change event handler, but I'm not sure how to select the targeted row and apply the bold fontWeight.
        • 1. Re: Formatting selected row in data grid
          michael_ramirez44 Level 1
          Use a labelFunction and apply it to all columns. In your label function you can add some logic to bold. GIve this a try. I have not tested it :)

          labelFunction(item:Object, column:DataGridColumn):String
          {
          if( dg.selectedItem == item )
          {
          column.setStyle("fontWeight","bold");
          return item[column.dataField];
          }
          else
          {
          column.setStyle("fontWeight","normal");
          return item[column.dataField];
          }
          }