User Profile & Activity

Mark Paladino Member
Page
of 5
Posted: November 11, 2009 5:20 AM

Hi Yudi, I have tested your sample and implemented your proposed solution into my application and I can confirm that the grids are now behaving exactly as I need them to.

Thanks for your assistance.

Posted: November 11, 2009 1:54 AM

Hi, my application is currently in the Alpha testing phase and is required to go to Beta testing in 15 business days. Can I please get an update on the status of this issue?

Posted: November 11, 2009 1:53 AM

Hi, my application is currently in the Alpha testing phase and is required to go to Beta testing in 15 business days. Can I please get an update on the status of this issue?

Posted: November 11, 2009 1:52 AM

Hi, my application is currently in the Alpha testing phase and is required to go to Beta testing in 15 business days. Can I please get an update on the status of this issue?

Posted: November 8, 2009 9:11 PM

Sample uploaded again.

Posted: November 8, 2009 5:37 PM

Hi, I think adding the Row Count text field added some confussion to the problem. I have removed this from the sample and re-uploaded it. The issue occurs in the function getTotalTax at the line

var wgRow = this.wgPurchaseDelivery.RootTable.GetRow(i);

after you delete a row that has been added to the grid and for every row you add there after.

Below are the steps to reproduce the issue:

1. Add 2 rows to the grid by pressing the add button twice. The column totals for the last 3 columns shoul be 2, 2 and 0

2. Delete 1 row. You would expect the column totals to be 1, 1 and 0 but they remain as 2, 2 and 0 because you get the null object javascript error when the totals are recalculated

3. Add another row to the grid and again you get the null object javascript error when the totals are recalculated

I am using WebGrid 7.0.7200.304

Can you please inform on how I can correct this issue?

1. Add 2 rows to the grid by pressing the add button twice. The column totals for the last 3 columns shoul be 2, 2 and 0

2. Delete 1 row. You would expect the column totals to be 1, 1 and 0 but they remain as 2, 2 and 0 because you get the null object javascript error when the totals are recalculated

3. Add another row to the grid and again you get the null object javascript error when the totals are recalculated

I am using WebGrid 7.0.7200.304

Can you please inform on how I can correct this issue?

Posted: November 5, 2009 12:36 AM
Thanks Handy, dlg.CommandButtons[0].GetElement().disabled = true; works correctly
Posted: November 4, 2009 11:06 PM

Hi, I am also trying to disable/enable my OK command button on my web dialog box via client side using dlg.CommandButtons[0].Disable(); but I am receiving the following javascript error: Object doesn't support this property or method.

Any suggestions on how this can be done?

Posted: November 4, 2009 9:14 PM

The table structure can be seen below. It is always the second grid which has the issue but this only happens sporadically.

 <table>
            <tr>
                <td class="PanelHeading" width="455"><%=SetCustomStringValue("Clerk Takings")%></td>
                <td <%= (IsNotToday ? "style=\"display: none;\"" : "") %>> </td>
                <td <%= (IsNotToday ? "style=\"display: none;\"" : "") %> class="PanelHeading" width="455"><%=SetCustomStringValue("Terminals")%></td>
            </tr>
            <tr>
                <td>                        
                    <table cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed;">
                        <tr><td>
                            <ISWebGrid:WebGrid ID="wgTakingsClerk" runat="server" Height="180px" Width="450px" DataSourceID="sdsTakingsClerk" />
                        </td></tr>
                    </table>
                </td>
                <td <%= (IsNotToday ? "style=\"display: none;\"" : "") %>></td>
                <td <%= (IsNotToday ? "style=\"display: none;\"" : "") %>>
                    <table cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed;">
                        <tr><td>
                            <ISWebGrid:WebGrid ID="wgTerminals" runat="server" Height="180px" Width="450px" DataSourceID="sdsTerminals" />
                        </td></tr>
                    </table>
                </td>
            </tr>
        </table>
Posted: November 4, 2009 8:52 PM

Hi sorry for the delay in reply. I am interested in having the ability to have an option such as scheduler.DataSource = ds because of the way our database library is composed. We have a objects that represent each table in our database. When these use lists of these objects to fill a dataset which we then assign to the grids on our pages. We would find it very beneficial if we could do something similar with the Scheduler component. A quick example of what I mean can be seen below:

 protected void wgStockTake_InitializeDataSource(object sender, DataSourceEventArgs e)
    {
        e.DataSource = GetStockTakeDataSet();
    }

private DataSet GetStockTakeDataSet()
    {
        DataSet ds = new DataSet();
        DataTable dt = ds.Tables.Add("StockTake");
        dt.Columns.Add("RowNum");
        dt.Columns.Add("ID", typeof(decimal));

        dt.Columns.Add("StockDescription", typeof(string));
        dt.Columns.Add("StockCode", typeof(string));
        dt.Columns.Add("CategoryDescription", typeof(string));
        dt.Columns.Add("GroupDescription", typeof(string));
        dt.Columns.Add("StockPLU", typeof(string));
        dt.Columns.Add("DefaultSupplier");
        dt.Columns.Add("StockBaseUnitDescription", typeof(string));
        dt.Columns.Add("StockTransferUnitDescription", typeof(string));
        dt.Columns.Add("StockReceivingUnitDescription", typeof(string));
        dt.Columns.Add("StockPurchaseUnitDescription", typeof(string));
        
        dt.Columns.Add("StockBaseQty", typeof(decimal));        
        dt.Columns.Add("StockTransferQty", typeof(decimal));
        dt.Columns.Add("StockReceivingQty", typeof(decimal));
        dt.Columns.Add("StockPurchaseQty", typeof(decimal));

        dt.Columns.Add("SnappedQOH", typeof(decimal));

        dt.Columns.Add("CountQOH", typeof(decimal));
        dt.Columns.Add("Variance", typeof(decimal));
        dt.Columns.Add("CountCost", typeof(decimal));
        dt.Columns.Add("VarianceCost", typeof(decimal));

        dt.Columns.Add("AdditionalData");

        int i = 1;
        if (wcLocation.Value != "")
        {
            StockTakeLocation stl = DataObject.StockTakeLocations[Convert.ToDecimal(wcLocation.Value)];
            stl.Refresh();

            foreach (StockTakeLocationItem item in stl.StockTakeLocationItems)
            {
                DataRow r = dt.NewRow();

                r["RowNum"] = i;

                r["ID"] = item.ID;

                r["StockDescription"] = item.Stock.Description;
                r["StockCode"] = item.Stock.Code;
                r["CategoryDescription"] = item.Stock.Category.Description;
                r["GroupDescription"] = item.Stock.Category.Group.Description;
                r["StockPLU"] = item.Stock.PLU;
                r["DefaultSupplier"] = item.Stock.DefaultSupplier.Description;
                r["StockBaseUnitDescription"] = item.Stock.BaseUnitDescription;
                r["StockTransferUnitDescription"] = item.Stock.TransferUnitDescription;
                r["StockReceivingUnitDescription"] = item.Stock.StockUnitDescription;
                r["StockPurchaseUnitDescription"] = item.Stock.PurchaseUnitDescription;

                string displayUnits = lstDDDisplayUnits.SelectedValue;

                QuestUnitTemplate ut = new QuestUnitTemplate(item.Stock.DefaultSupplierID, item.Stock, base.Department.ID);

                string additionalData = "";
                QuestHelper.AppendCommonAdditionalData(ut, ref additionalData);

                additionalData += "|" + item.CountBaseUnitQuantityPosted.ToString().ToLower() +
                    "|" + item.CountTransferUnitQuantityPosted.ToString().ToLower() +
                    "|" + item.CountStockUnitQuantityPosted.ToString().ToLower() +
                    "|" + item.CountPurchaseUnitQuantityPosted.ToString().ToLower() +
                    "|" + item.Stock.BaseUnitCurrentCost;
               
                r["StockBaseQty"] = item.CountBaseUnitQuantity;
                r["StockTransferQty"] = item.CountTransferUnitQuantity;
                r["StockReceivingQty"] = item.CountStockUnitQuantity;
                r["StockPurchaseQty"] = item.CountPurchaseUnitQuantity;

                decimal qohAsBase = 0;
                ut.SetQuantityFromDisplay("B", item.BaseUnitQuantity);
                qohAsBase = ut.QuantityAsBaseUnit;
                r["SnappedQOH"] = qohAsBase;

                additionalData += "|" + qohAsBase;

                decimal totalAsBase = item.CountBaseUnitQuantity;
                ut.SetQuantityFromDisplay("T", item.CountTransferUnitQuantity);
                totalAsBase += ut.QuantityAsBaseUnit;

                ut.SetQuantityFromDisplay("S", item.CountStockUnitQuantity);
                totalAsBase += ut.QuantityAsBaseUnit;

                ut.SetQuantityFromDisplay("P", item.CountPurchaseUnitQuantity);
                totalAsBase += ut.QuantityAsBaseUnit;

                ut.SetQuantityFromDisplay("B", totalAsBase);
                r["CountQOH"] = ut.GetQuantityForDisplay(displayUnits);

                decimal varianceAsBase = (totalAsBase - qohAsBase);
                decimal countCostAsBase = (totalAsBase * item.Stock.BaseUnitCurrentCost);

                bool quantityPosted = (item.CountStockUnitQuantityPosted || item.CountTransferUnitQuantityPosted || item.CountBaseUnitQuantityPosted || item.CountPurchaseUnitQuantityPosted);

                ut.SetQuantityFromDisplay("B", varianceAsBase);
                r["Variance"] = (quantityPosted == true) ? ut.GetQuantityForDisplay(displayUnits) : 0;
                r["VarianceCost"] = (quantityPosted == true) ? (ut.GetQuantityForDisplay(displayUnits) * item.Stock.BaseUnitCurrentCost) : 0;

                ut.SetQuantityFromDisplay("B", countCostAsBase);
                r["CountCost"] = ut.GetQuantityForDisplay(displayUnits);

                r["AdditionalData"] = additionalData;

                i++;

                dt.Rows.Add(r);
            }
        }

        return ds;
    }
All times are GMT -5. The time now is 11:21 PM.
Previous Next