Page 1 of 1

Simple Batch Edit Question

Posted: Thu Oct 21, 2010 8:11 am
by bladegrasp
Hello Able!

Quick question: I added a column to ac_Products which is called "Rarity" and has 4 possible string values: R, U, C, or M

I need to be able to get this column to show on batch edit. I've tried to the best of my ability and I end up always looking at Products metadata. Here's what I've done so far:

On ../Admin/Products/Batching/BatchEdit.aspx.csm added the following code which generated the field "rarity":

Code: Select all

    private void InitializeFieldSelections()
    {
        // BUILD THE LIST OF AVAILABLE FIELDS
        _ProductFields["rarity"] = "Rarity";  // ADDED LINE
and

Code: Select all

        // SET FIELD DESCRIPTIONS
        _ProductFieldDescriptions["rarity"] = "Product Rarity";     // ADDED LINE

And added the "rarity" case to the drawfields like so:

Code: Select all

  private List<Control> DrawField(Product product, string field, out string cellAlignment)
    {
        cellAlignment = string.Empty;
        if (field != null)
        {
            string cleanField = field.Trim().ToLowerInvariant();
            switch (cleanField)
            {
                case "rarity":        // ADDED LINE
                    return DrawTextField(product.ProductId, cleanField, "R", 255, 200, false);   // ADDED LINE
On that last bit of code there's an "R". Normally I would need to put a string there which would be product.Name for example.
What I need to accomplish is to get rid of the "R" and substitute it with something like product.Name but for the Rarity column.


I really need some guidance on how to go on with this part of the process; If I had an idea I wouldn't post for help.


Thank you in advance for your time and attention!
Bladegrasp~

Re: Simple Batch Edit Question

Posted: Sat Oct 23, 2010 4:33 am
by bladegrasp
Anyone got any ideas on this? Haven't found a good workaround yet but still trying.