User Profile & Activity

Glenn Layaar Support
Page
of 99

I am very sorry, however I do not have any update for the issue. The issue is still active and I still do not have any fixed date for the hotfix release.

Posted: June 23, 2010 6:06 AM

Based on my test, this issue seems to be caused by a bug. A bug report has been submitted to our developer. We will inform you if there is any update or progress regarding this issue.

Unfortunately, We do not have Windows 2008 R2 in our environment. However, we will try to installed the OS in our environment with the specification you desribed to further investigate the issue. It will take a few days to a week in order to prepare the system in our environment. We will inform you if there is any update.

Posted: June 22, 2010 1:28 AM

Using the attached sample in the blog I have no problem in adding single day event to the WebScheduler. However, the sample was not prepared for recurring event or new category and resource which is available if you are using the default editing form.

In order to enable the function correctly you will need to update the dsSchedulerDB_Extended.cs to include the other table as well not only the Events table. You could view this in our provided WebScheduler sample.

Posted: June 21, 2010 11:40 PM

Since we already using browser native API, we could not boost the performance anymore in the client side. However, you could try aborting the column moving in the client side and move the process to the server side. From your remark, it seems the server process will be quicker for you.

The workaround would be to abort the column moving in client side by returning false in the ColumnMove client side event handler and send the modified column position to the server. After ward we need to call WebGrid RefreshAll function in order to rebuild the column structure in the server during prepare data binding. You could save the column structure in a session on the server side.

Here is the snippet:

//Abort column move and invoke RefreshAll
function wgTest_OnColumnMove(controlId, tblName, oldPost, newPost, currCol, destCol)
{
setTimeout(function ()
{
var grid = ISGetObject("wgTest");

grid.AddInput("newColPost", [destCol.Name + "|" + oldPost, currCol.Name + "|" + newPost].join(";"));

grid.RefreshAll();

}, 100);

return false;
}


protected void Page_Init(object sender, EventArgs e)
{
//Initialize column session
if (Session["colList"] == null)
{
Session.Add("colList", new string[]{
"ID2",
"checkbox",
"ID",
"Interest",
"Price",
"DateNow",
"Description",
"Link",
"FirstName",
"LastName",
"FullName"
});
}
}
protected void Page_Load(object sender, EventArgs e)
{
//Determine if a there is a modified column
if (!string.IsNullOrEmpty(Request["newColPost"]))
{
string[] cols = Request["newColPost"].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
foreach (string col in cols)
{
string[] colSect = col.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);

string[] colList = (string[])Session["colList"];
colList[int.Parse(colSect[1]) - 1] = colSect[0];
Session["colList"] = colList;
}
}

}
void wgTest_PrepareDataBinding(object sender, DataSourceEventArgs e)
{
if (!Page.IsPostBack || wgTest.ActionName == "RefreshAll")
{
wgTest.RootTable.Columns.Clear();

string[] colList = (string[])Session["colList"];
foreach (string col in colList)
{
WebGridColumn gridCol = null;
switch (col)
{
//Build the WebGrid column
}

wgTest.RootTable.Columns.Add(gridCol);
}
}
}


Posted: June 21, 2010 9:58 PM

In my test, you could use the InitializeRow server side event handler in order to attach the onclick client side event handler and set the hyperlink to # in order to acachieve the scenario you wanted. You will still need to set the column type as hyperlink. Here is the snippet for InitializeRow server side event handler:

protected void wgTest_InitializeRow(object sender, RowEventArgs e)
{
if (e.Row.Type == RowType.Record)
{
e.Row.Cells.GetNamedItem("Link").CustomObjectAttributes = "onclick=\"alert('link click');\" href=\"#\" target=\"_self\"";
}
}


Based on my discussion with the developer, I believe that the columing moving API which implemented in the WebGrid is using native browser javascript engine. Based on our test, 500 column moving will be a bit slow in IE, however in other browser, such as FireFox or Chrome it is quite fast.

I assume you are talking about the workaround where the DataKeyField of the parent table is hidden. For such scenario, you will need to manually insert the parent key value into the HTML child table new row cell during BeginRowEditing client side event handler.

THe snippet provide below assume the parent table is named CustomerObj while the child table is named OrderObj. The parent key is located on the second column of the child table.

In order to correctly retrieve the parent key value from the child table, you will need to modify the AddPendingChanges client side event handler into:

function WebGrid1_OnAddPendingChanges(controlId, table, rowChange)
{
var grid = ISGetObject(controlId);

if (table.Name == "CustomerObj")
{
setTimeout(function ()
{
//debugger;
rowChange.Element.setAttribute("KeyValue", idTemp);
rowChange.KeyValues = idTemp + "";
rowChange.Row.KeyValue = idTemp + "";
idTemp++;
}, 10);
}
}

Here is the snippet for BeginRowEditing client side event handler:   

function WebGrid1_OnBeginRowEditing(controlId, row)
{
var grid = ISGetObject(controlId);

if (row.Type == "NewRow" && row.Table.Name == "OrderObj")
{
var cells = row.GetElement().getElementsByTagName("td");
var idx = 0;

for (var i = 0; i < cells.length; i++)
{
if(cells[i].getAttribute("type") == "Cell")
{
if (idx == 1)
{
var parentKey = row.GetParentRow().KeyValue;
cells[i].innerHTML = parentKey;
cells[i].setAttribute("cellValue", parentKey);
break;
}

idx++;
}
}
}
}


In the firefox screenshot, I could see that the SelectedRow will modify the background color to #9FC9FB. Try setting the background color to white in the WebGrid selected row style in order to keep the default row style.

From my test, the code will be the same, adding WebGrid filter to FilteredColumns collection. However, if you are using WebValueList, the filter text will be the value of the DataValueField you assign in the WebValueList.

All times are GMT -5. The time now is 9:28 AM.
Previous Next