User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: June 13, 2010 9:51 PM

Using the provided SaveRestoreLayout.aspx tutorial sample under V3.1 folder, I could save & restore the WebGrid layout and filter the data without any issue you mention. By default the sample does not allow filtering, however you could enable filtering by setting AllowFilter="Yes" under LayoutSettings. Have you tried using the technique in the tutorial sample?

If the method is not applicable, please provide us with a simple running sample so we could analyze the issue further.

Posted: June 10, 2010 10:18 PM

You will need to add a new ChartPivotDataConfig in the chart data collection and a new ChartPivotFilterConfig in the char category collection. Here is the snippet, I'm using lambda expression to insert the property in the object:

Protected Sub WebGrid1_ChartImageProcessing(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.Chart.WebGridChartEventArgs) Handles WebGrid1.ChartImageProcessing
e.ChartConfig.ChartDataCollection.Add(New ChartPivotDataConfig() With {.DataMember = "ID"})
e.ChartConfig.ChartCategoryCollection.Add(New ChartPivotFilterConfig() With {.DataMember = "Interest"})
End Sub


 

Posted: June 10, 2010 3:15 AM

I have discussed this issue with the developer and unfortunately, we do not have a workaround for the TotalRecurrence issue. Using the workaround from the previous post the TotalRecurence will not account for the holidays and the total event displayed will be less than the TotalRecurrence pattern.

Regarding holidays from external database, you will need to buffer the list in a HTML hidden input and match the holiday list with the event start time during the OnEventBound client side event handler. There is no workaround to hide the individual recuring event from the server.  

In order to retrieve the text, assuming you are using BatchUpdate WebGrid, you will need to set the value of the cell with the value and invoke ActivateEdit function. Afterward during the OnEnterEditMode client side event handler you will need to retrieve the text from the editobject, in this case a HTML select element. Here is the snippet, assuming we are trying to set the Interest column second row of WebGrid with the value of 2:
function UpdateGrid()
{
var wgTest = ISGetObject("wgTest");
var row = wgTest.RootTable.GetRow(2);
var cells = row.GetCells();
var interestCell = cells.GetNamedItem('Interest');

interestCell.SetValue("1");
row.Select();
interestCell.ActivateEdit();

row.SetDataChanged();
row.Update();

wgTest.MarkEdit();
}

function wgTest_OnEnterEditMode(controlId, tblName, editObject)
{
var wgTest = ISGetObject(controlId);
var selIndex = editObject.element.selectedIndex
var selText = editObject.element.options[selIndex].text;

editObject.ToCellObject().SetText(selText);
}
Another suggestion is, depending on the search functionality, you could try retrieving both the cell WebValueList value and cell WebValueList name during the search function.  

Such issue is usually caused by missing dll in your project folder. If you are using basic feature WebGrid control the required dll in the project folder are:

- ISNet.dll
- ISNet.WebUI.dll
- ISNet.WebUI.WebGrid.dll
- ISNet.WebUI.WebGrid.Resources.dll (if using SmartWebResources)
- ISNet.WebUI.WebDesktop.Resources.dll (if using SmartWebResources)
- ISNet.WebUI.Resources.dll (if using SmartWebResources)

More detailed is available in the WebGrid documentation on the article "Deploying project that uses SmartWebResources" or "Deploying project that does not use SmartWebResources"

Posted: June 9, 2010 1:02 AM

Unfrotunately such scenario has not been supported by WebScheduler. 

However, after discussing this issue with the developer, a workaround would be to hide the event which shown in the holiday date. This could be achieved using OnEventBound client side event handler by comparing the event date and holidays, if it match set the css style of the event so the event will be hidden. Here is the snippet:

function WebScheduler1_OnEventBound(controlId, evt)
{
var sched = ISGetObject(controlId);

var evtDay = [evt.StartTime.getDate(), evt.StartTime.getDay(), evt.StartTime.getFullYear()].join("/");

for (var i = 0; i < sched.Holidays.length; i++)
{
var hDate = sched.Holidays[i].Date;
var hDateStr = [hDate.getDate(), hDate.getDay(), hDate.getFullYear()].join("/");
if (evtDay == hDateStr)
{
evt.Element.style.display = "none";
}
}
}


I have updated the sample so there is a button to add and update row in server side, the basic idea is still the same. Sample attached.

The database operation, for simplicity is using data adapter, since internally WebGrid will mark the updated, added, or deleted data row with the correct row state (Modified, Added, or deleted ), so calling the data adapter update method will process the modified, deleted, and added data based on the data adapter update, insert, or delete command.

In my sample, during AddRow and UpdateRow event handler I return false in order to prevent the WebGrid internal event handler to execute because we are not doing any database operation.

Regarding the error you mention during Add Row buton click, I have not encounter such issue in my environment, have you used the latest WebGrid 6 and WebUI Framework 3? The latest build is 219 and 752 respectively.

I can't comment on whether the design is bad or good. However, I have provide an alternative method if you willing to try.  


Posted: June 8, 2010 11:28 PM

You could retrieve the selection of the HTML element the command executed on using the GetSelectionParentNode function. For your scenario, you try using the OnAfterExecCommand event handler and rewrite the HTML element so the style tag will be outside of the SPAN with the type attribute mailmerge

Here is the snippet for Bold command:

function WebTextEditor_OnAfterExecCommand(controlId, action)
{
var WebTextEditor = ISGetObject(controlId);
var selection = WebTextEditor.GetSelectionParentNode();

if(selection.parentElement.getAttribute("type") == "mailmerge")
{
switch(action)
{
case "Bold":
var oNew = document.createElement("strong");
selection.parentElement.parentElement.insertBefore(oNew, selection.parentElement);
oNew.appendChild(selection.parentElement);

selection.parentElement.innerHTML = selection.parentElement.innerHTML.replace(/<strong>/i, "").replace(/<\/strong>/i, "");
break;
}
}
}


Posted: June 8, 2010 12:25 AM

I am still disucssing the cusror position selection with the developer. I will inform you in this thread after I have some update regarding the issue.

What you are trying to achieve is called bulk update in WebGrid 6 and we already have an article regarding this feature in this page.

If you would like to programatically add and edit WebGrid row, we already provided a sample on Client_ProgrammaticEdit.aspx.

I have attached a simple sample that demonstrate both of this functionality. Database operation will only be executed when [Save] button is clicked. The button [Add Row] will add a new row with static data, while the [Update Row] button will modify the ContactName and ContactTitle of the first row in the Grid. The sample is using northwind.mdb database which has already been provided in WebGrid sample.

If you are willing to upgrade to WebGrid 7, the feature has been natively supported using the batch update feature. We have also provided batch update feature in WebGrid 7 provided sample.
All times are GMT -5. The time now is 3:49 PM.
Previous Next