Updatable Dashboard "Select All" Option?

I have recently created an updatable dashboard that pulls in the Part, Part Description, and Process MRP. Everything works as it should, but it would be nice to not have to click on each individual line. Is there a way to create a “Select All” option, so that the user can click on that and it updates all the ProcessMRP within the dashboard?

Thanks,
Melissa

I’ll be interested to hear how to do this programmatically (is that even a word?).

A quick hack would be to right click and select all. Then paste it into a spreadsheet, update that column (using Fill Down). Copy the cells from Excel, and paste back into the dashboard.

I think you’d have to have mult-row enabled, so each could be updated without an update in between.

The standard warnings about pasting into tables apply.

Create a UI customization on your deployed dashboard assembly.

/* Grab your grid */
    EpiUltraGrid myGrid
    {
        get
        {
            return (EpiUltraGrid)
                csm.GetNativeControlReference("facaf8c0-2602-4d72-9bf5-ec9b6c63170f");
        }
    }

/* if you want to select all, you'll want to unselect all sooner or later */
    private void btnUnSelectAll_Click(object sender, System.EventArgs args)
    {
        ChangeAll(myGrid.Rows, false);
        myGrid.Selected.Rows.Clear();
    }

/* confirmation msg box is entirely optional */
    private void btnSelectAll_Click(object sender, System.EventArgs args)
    {
        int cnt = myGrid.Rows.Count;
        string msg = string.Format("There are '{0}' rows in the grid.  Are you really realy REALLY sure you want to select ALL '{0}' rows?  Click Yes to confrim, No to cancel", cnt);
        if (MessageBox.Show(msg, "Select all the jobs", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
        {
            ChangeAll(myGrid.Rows, true);
        }
    }

/* why is this it's own function?  well it can handle selecting and unselecting and it can handle grouping within your grid */
    public void ChangeAll(RowsCollection row, bool val)
    {
        foreach (UltraGridRow r in row)
        {
            if (r.GetType() == typeof(UltraGridGroupByRow))
                ChangeAll(((UltraGridGroupByRow)r).Rows, val);
            else
                r.Cells["Calculated_FirmJob"].Value = val; /* change to whatever column you are updating for selection */
        }
    }
2 Likes

Does it matter whether or not the Updateable BAQ allows multi-row updates?

As my understanding (which could very well be wrong), is that only one row can be updated if multi-row updates are not enabled. If multi-row updates are not enabled, does the update happen upon changing rows?

Calvin,

Thanks, that seemed to work out great.

Thanks,
Melissa

I have made a suggestion that we should be able to create a “CustomAction” in the Updatable BAQ that would allow this… but as of now, it is simply not possible without doing the customization that @rbucek did. I can create a custom action, and i can make it “LOOK” like all the rows are updated, but the way that the updateable dashboard data appears to the BAQ BPM, you cannot make the rows look dirty.

taking that one step further, you could ‘fake’ it by making a calculated field (checkbox) updateable that is essentially bound to nothing and using advanced bpm update only over ride the base update method and put a comment only in there. Essentially doing NO update at all or a custom update of your choosing.

You would actually handle most of if not all of the work in the UI layer calling the BO/Methods yourself based on whether or not that check box is true or false. Your BAQ at that point should filter out processed records after a refresh that you call yourself or let the user do. That’s really getting into the weeds but it’s a great alternative to the SDK for creating custom forms etc for processing things when you don’t want to go to a UD table/form.

1 Like