private void removeRow(Row row) {
    try {
      if (row.getGrid().getRows() != null) {
        row.getGrid().renderAll();
        int rowIndex = row.getGrid().getRows().getChildren().indexOf(row);

        ListModelList model = (ListModelList) row.getGrid().getListModel();
        DefaultFormatMapEntries entries = (DefaultFormatMapEntries) model.get(rowIndex);
        model.remove(rowIndex);
        String rateformtname = entries.getRateFormat();
        if (rateformtname.contains("VF_")) rateformtname = rateformtname.replaceAll("VF_", "");
        rateForamatSelected.remove(rateformtname);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  @Override
  public void render(final Row row, Object object) throws Exception {
    if (inputfmtcombo != null) {
      inputRateSelected = inputfmtcombo.getText();
      if (!inputRateSelected.contains("VFI_")) inputRateSelected = "VFI_" + inputRateSelected;
    }
    final DefaultFormatMapEntries fmtMapEntry = (DefaultFormatMapEntries) object;
    final Combobox inputFormatCombo = new Combobox();
    inputFormatCombo.setReadonly(true);
    String rateFormat = fmtMapEntry.getRateFormat();
    if (rateFormat.contains("VF_")) rateFormat = rateFormat.replaceAll("VF_", "");
    inputFormatCombo.setText(rateFormat);
    rateForamatSelected.add(rateFormat);
    if (fmtMapEntry.isOnEdit()) inputFormatCombo.setDisabled(true);
    final Collection<String> comboRateArray = new ArrayList<String>();
    if (inputRateSelected.equals("VFI_480i")) {

      comboRateArray.add(VideoFormatT.findByValue(21).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(22).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(23).toString().replaceAll("VF_", ""));
    } else {

      comboRateArray.add(VideoFormatT.findByValue(1).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(2).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(3).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(4).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(5).toString().replaceAll("VF_", ""));
    }
    comboRateArray.removeAll(rateForamatSelected);
    inputFormatCombo.setModel(new ListModelList(comboRateArray));
    ComboitemRenderer renderer =
        new ComboitemRenderer() {

          @Override
          public void render(Comboitem item, Object data) throws Exception {
            String audiotype = data.toString();
            item.setLabel(audiotype);
          }
        };
    inputFormatCombo.setItemRenderer(renderer);

    inputFormatCombo.addEventListener(
        Events.ON_OPEN,
        new EventListener() {

          public void onEvent(Event event) throws Exception {
            // inputFormatCombo.getModel().getSize();
            comboRateArray.removeAll(rateForamatSelected);
            inputFormatCombo.setModel(new ListModelList(comboRateArray));
          }
        });
    inputFormatCombo.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {

          public void onEvent(Event event) throws Exception {
            String rateformtname = inputFormatCombo.getText();
            if (!rateformtname.contains("VF_")) rateformtname = "VF_" + rateformtname;
            fmtMapEntry.setRateFormat(rateformtname);
            System.out.println("......." + rateForamatSelected + rateformtname);
            rateForamatSelected.add(inputFormatCombo.getText());

            inputFormatCombo.setDisabled(true);
          }
        });

    inputFormatCombo.setParent(row);

    final Intbox bitrateIntBox = new Intbox();
    bitrateIntBox.setMaxlength(5);
    bitrateIntBox.setConstraint(new IntValueConstraint());
    bitrateIntBox.setText(fmtMapEntry.getBitRate());
    bitrateIntBox.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {
          public void onEvent(Event event) throws Exception {

            try {
              fmtMapEntry.setBitRate(bitrateIntBox.getText());
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        });
    bitrateIntBox.setParent(row);
    final Button cancelBtn = new Button();

    cancelBtn.setSclass("check_off");
    cancelBtn.setTooltiptext("Delete");

    cancelBtn.addEventListener(
        Events.ON_CLICK,
        new EventListener() {
          public void onEvent(Event event) throws Exception {

            if (row.getGrid().getListModel().getSize() > 1) {
              removeRow(row);
            } else {
              Messagebox.show(
                  "Sorry,You will not be able to delete this row.!",
                  "Aereo",
                  Messagebox.OK,
                  Messagebox.INFORMATION);
            }
          }
        });

    cancelBtn.setParent(row);
  }