User Profile & Activity

Glenn Layaar Support
Page
of 99

A WebInput feature request has been created to support positive or negative only number.

Posted: November 12, 2009 9:43 PM

Please try this.

During your wgProductionTemplateStock_CheckBoxClick function, please set the color mofification cell code after the AddRow operation. Here is the snippet:

productionForecastTemplate.webGridCommon.updateFieldValue(cells, "DefaultWastage", cells.GetNamedItem("DefaultWastage").Value);
productionForecastTemplate.webGridCommon.updateFieldValue(cells, "CutSize", cells.GetNamedItem("CutSize").Value);
row.AddPendingChanges();

if (checkboxValue == true) {
var cellElement = cells.GetNamedItem("DefaultWastage").GetElement();
cellElement.style.cssText = "background-color: #8FBC8F !important;";

cellElement = cells.GetNamedItem("CutSize").GetElement();
cellElement.style.cssText = "background-color: #8FBC8F !important;";
}
else {
var cellElement = cells.GetNamedItem("DefaultWastage").GetElement();
cellElement.style.cssText = "background-color: #F4F4F4 !important;";

cellElement = cells.GetNamedItem("CutSize").GetElement();
cellElement.style.cssText = "background-color: #F4F4F4 !important;";
}

I also suggest implementing RowSelect client side event to override the selected roe style to the custom row style you have defined. Here is the snippet:

function wgProductionTemplateStock_RowSelect(ctrlId, tblName, rowIndex, rowElem) {
var grid = ISGetObject(ctrlId);

var rowObj = grid.GetRowByElement(rowElem);

var cells = rowObj.GetCells();

var checkboxValue = cells.GetNamedItem("RC").Value;

if (checkboxValue == true) {
var cellElement = cells.GetNamedItem("DefaultWastage").GetElement();
cellElement.style.cssText = "background-color: #8FBC8F !important;";

cellElement = cells.GetNamedItem("CutSize").GetElement();
cellElement.style.cssText = "background-color: #8FBC8F !important;";
}
else {
var cellElement = cells.GetNamedItem("DefaultWastage").GetElement();
cellElement.style.cssText = "background-color: #F4F4F4 !important;";

cellElement = cells.GetNamedItem("CutSize").GetElement();
cellElement.style.cssText = "background-color: #F4F4F4 !important;";
}

return true;
}


The !important tag will be needed for the code to work in IE8.


After discussing this issue with the developer, It seems you need to set the AutoLoadMetaData to false for the FlyPostBackManager in FormAuthenthication project. The MetaDataCollection must be done manually. Attached is the sample that the developer provided to simulate the issue.

I remove the bin folder to reduce the size of the attachment.

Username is user@intersoftpt.com and password is !nt3rsoft

This functionality is not supported by default, however you could use the AfterValueChanged client side event to override the value to the value you desire, using the SetValueData WebInput function.

Attached is the sample I used to replicate the scenario.

Posted: November 11, 2009 9:29 PM

Here is the script snippet for your issue:

issue #1:

function grdObj_OnAfterInitialize(controlId)
{
var grdObj = ISGetObject(controlId);

var headerRows = grdObj.RootTable.GetElement(WG40.COLHEADER, WG40.HTMLROW).getElementsByTagName("tr");

for (var i = 0; i < headerRows.length; i++) {
if (headerRows[i].type == "RowSeparator" || headerRows[i].type == "FilterRow") {
var colElem = headerRows[i].getElementsByTagName("td");
for (var j = 0; j < colElem.length; j++)
colElem[j].style.borderTopColor = "#DBDBDB";
}
}

return true;
}

issue #2:

function grdObj_OnAfterInitialize(controlId)
{
var grdObj = ISGetObject(controlId);

var headerRows = grdObj.RootTable.GetElement(WG40.COLHEADER, WG40.HTMLROW).getElementsByTagName("tr");

for (var i = 0; i < headerRows.length; i++) {
if (headerRows[i].type == "ColHeader") {
var colElem = headerRows[i].getElementsByTagName("td");
colElem[2].style.borderRightColor = "";
colElem[2].style.borderRightWidth = "";
}
}

return true;
}

Since you are using skin you will need to set the event handling in the skin file.

<LayoutSettings>
<ClientSideEvents OnAfterInitialize="grdObj_OnAfterInitialize"/>
...
</LayoutSettings>



Posted: November 10, 2009 4:08 AM

Attached is the sample I used to recreate the scenario you described. We found there is some issue if we try to spellcheck the same textbox more than once in IE8. i have forwarded this issue to our developer and it is being investigated.

However, in other browser I could not replicate the IE8 issue. Is this the issue you mentioned in your thread?

Posted: November 10, 2009 4:00 AM

Issue#1:

The HeaderStyle will be applied to each TR element in the header section, in your project sample, the Header section has 3 TR element and each TR is applied the correct style.


Issue#2:

The WebGrid header freeze pane border style currently could not be modified using the skin. If you would like to modify the style you will need to change the element style manually during WebGrid Initialize event.

Posted: November 10, 2009 2:03 AM

It seems I misunderstand the issue, my superior send me your email:

I have a grid that has two child tables(3levels). I also have a column in each table called “VisibleLevel,” whichis hidden.

I need to populate this column automatically with the level of the band (0,1,2) when a new row is created. How do I do this on the server-side?

Attached is a simple sample if you wish to add certain data to a undisplayed data source column. During AddRow server side event you will need to set the undisplayed data source column with the value you wish. The sample will require Northwind.mdb data

In your scenario, you will need to differentiate between row added in the parent or child table, using the e.Row.Table.Name(determine the table name) / e.Row.Table.TableLevel(determine the level of the table) property in the AddRow server side event should be sufficient.

Attached is a similar sample with your scenario. The sample is using LINQ data as the datasource and will filter the data based on the parameter set in a form. The parameter will be sent to the Grid using AddInput client side method and refreshing the data is achieved by using RefreshAll method.

Posted: November 9, 2009 9:40 PM

RestoreExpandedChildRows will only works for hierarchical table. Currently, there is no native property / function available to restore the grouped rows.

However, a workaround is available, by buffering the expanded grouped row to a temporary variable and re-expand the selected group row after the flypostback is finished. In your case, the batch update. Attached is a demonstration of the workaround.

All times are GMT -5. The time now is 4:13 PM.
Previous Next