User Profile & Activity

Adrian Cunningham Member
Page
of 3
Posted: October 4, 2010 3:15 PM

Andi,


Can you tell me the exact version of the WebGrid DLL I need that has this fix, as the version I have contains the method you refer to but I still get errors after doing a batch update via the "PerformBatchUpdate" method.

Regards,

Adrian.

Posted: September 30, 2010 1:58 PM

Hey Andi,


Just wondering if this issue has been resolved yet as it is a bit of pain having to a Response.Redirect after every batch update.

Regards,

Adrian.

Posted: September 21, 2010 11:41 AM

Been having problems posting to site so just testing with this post. please ignore.

Posted: September 2, 2010 4:40 PM

Handy,

 

Been having problems posting to this site, some internal issues, so please disregard this post as it is a test for me.

Regards,

Adrian.

Posted: August 11, 2010 3:34 PM

Handy,

Thanks, do you have any idea when a fix would be ready for this?  Otherwise I'll have to find another Rich Text Control as a replacement in meantime such as that from the Ajax Toolkit.


Regards,

Adrian.

Posted: May 14, 2010 8:12 AM

Glen,

I figured out what the issue was.  My original version had the markup defining the layout of the gird which never quite worked so I configured my grid in the Code-Behind in the PrepareDataBinding method.

However, I never actually removed the markup which was somehow interfering with the layout generated by the code-behind, so I removed the markup and this has resolved my issue.


Regards,

Adrian.

Posted: May 12, 2010 8:27 AM
Glen,

The RowChecker columns are not bound to a database field, I manual created the Row Checker columns in the PrepareDataBinding method in the code behind and I still get this strange behaviour.

Any ideas?

Here is the code for creating the row check columns:

WebGridColumnCollection rootColumns = grdEDMPortfolios.RootTable.Columns;
rootColumns.Insert(0, new WebGridColumn("chkEDM", "", " ", new Unit("23px"), ColumnType.CheckBox, EditType.NoEdit, ""));
rootColumns.GetNamedItem("chkEDM").IsRowChecker = true;
rootColumns.GetNamedItem("chkEDM").Bound = false;

WebGridTable childTable = grdEDMPortfolios.RootTable.ChildTables[0];
WebGridColumnCollection childColumns = grdEDMPortfolios.RootTable.ChildTables[0].Columns;
childColumns.Insert(0, new WebGridColumn("chkPortfolio", "", " ", new Unit("23px"), ColumnType.CheckBox, EditType.NoEdit, ""));
childColumns.GetNamedItem("chkPortfolio").IsRowChecker = true;
childColumns.GetNamedItem("chkPortfolio").Bound = false;

Regards,

Adrian.

Posted: May 11, 2010 8:17 AM

Glen,

I have already been using the settings that you provided and it still doesn't work. There is some slighly strange behaviour, let me explain some more.

I configure my hierarchical grid in the PrepareDataBinding method in the code behind:

WebGridColumnCollection rootColumns = grdEDMPortfolios.RootTable.Columns;
rootColumns.Insert(0, new WebGridColumn("chkEDM", AWBConstants.COL_REGISTRATION_ID, " ", new Unit("23px"), ColumnType.CheckBox, EditType.Checkbox, ""));
rootColumns.GetNamedItem("chkEDM").IsRowChecker = true;

WebGridTable childTable = grdEDMPortfolios.RootTable.ChildTables[0];
WebGridColumnCollection childColumns = grdEDMPortfolios.RootTable.ChildTables[0].Columns;
childColumns.Insert(0, new WebGridColumn("chkPortfolio", AWBConstants.COL_PORTFOLIO_ID, " ", new Unit("23px"), ColumnType.CheckBox, EditType.Checkbox, ""));
childColumns.GetNamedItem("chkPortfolio").IsRowChecker = true;

Here I hide various columns I don't need as well as added my parent row checker column "chkEDM" and my child row checker column "chkPortfolio". The grid layout settings you stated above are set in the markup.

I have also added a client side OnCheckBoxClick function to trigger a parent checkbox to check all children and vice versa. Here is is the code:

    function grdEDMPortfolios_CheckBoxClick(gridId, tblName, colName, checkboxValue)
{
var grid = ISGetObject(gridId);
var selectedRow = grid.GetSelectedObject().GetRowObject();

if (colName == "chkEDM")
{

if (selectedRow.Table.ChildTables.length > 0)
{

var childRows = selectedRow.GetChildRows("PortfolioCollection");
for (var i = 0; i < childRows.length; i++)
{
if(!childRows[i].GetCells().GetNamedItem("chkPortfolio").ForceNoEdit)
{
if (checkboxValue)
{
childRows[i].Check();
}
else
{
childRows[i].Uncheck();
}
}
}
}
}
EnableCopyToShell();
return true;
}

The behaviour I witness is as follows:

  1. Click on one of the child check boxes.
  2. Click the grid's refresh icon
  3. The child checkbox is persisted after the grid refreshes.
  4. Click on the child checkbox again then click refresh.
  5. After refresh all child checkboxes are selected even though only one was selected.
Regards,
Adrian.
Posted: May 10, 2010 6:00 PM

Yudi,

Thanks of the response.  I've worked around the issue of the ".Rows" property of the WebGridTable always being null (seems kind of pointless to document this property if it doesn't actually work) but my solution is similar to yours in that I have to iterate through all the RootTable rows and call GetChildRows() methods.

        for(var i = 0; i < totalRows; i++)
{
var childRows = grid.RootTable.GetRow(i).GetChildRows();
for(var j = 0; j < childRows.length; j++)
{
if(childRows[j].GetCells().GetNamedItem("StatusID").Value != 352 && // Completed
childRows[j].GetCells().GetNamedItem("StatusID").Value != 353 && // Failed
childRows[j].GetCells().GetNamedItem("StatusID").Value != 354) // Peril not found.
{
window.setTimeout("WebGrid_RefreshGrid('grdEDMPortfolios');", 15000);
return;
}
}
}

Regards,

Adrian.

 

Glen,

Is it not possible at all to:

  • Define the hierarchical grid structure client side
  • use the concrete collection classes e.g. CustomerCollection, OrderCollection - which impletement IHierarchicalList and IObjectRelates
  • Populate Parent collection class and all of its children
  • Then bind the grid in the IntializeDataSource method like I did earlier and have the grid display correctly.
I'm currently having issues where the grid doesn't display as hierarchial but flat.

Regards,
Adrian.
All times are GMT -5. The time now is 5:26 PM.
Previous Next