User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: January 2, 2011 10:29 PM

Based on the first post, the GetFocusedElement API is invoked from the CloseCurrentWindow method. Does the save button click handler is set to the CloseCurrentWindow method? if not perhaps there is some earlier method that could cause the save button to lost focus. Do you mind providing us a simple runnable sample so we could invetigate the issue further?

Posted: December 29, 2010 10:06 PM

In such scenario, you will need to re-apply the change background color logic in the AfterExitEditMode client side event handler. By default the WebGrid will apply the edited row with a predefined style. Here is the snippet to changed the background color during AfterExitEditMode event handler:

function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) {
var grid = ISGetObject(controlId);
var selObj = grid.GetSelectedObject();
var row = selObj.ToRowObject();
var rowCells = row.GetCells();

var columnLength = grid.RootTable.Columns.length;
var rowObject = row;
for (var i = 1; i <= columnLength; i++) {
var rowElement = rowObject.RowElement;
if (rowElement != null) {
var cell = rowElement.cells[i];
if (cell != null) { cell.style.setAttribute("backgroundColor", "Red", true); }
}
}
}



Posted: December 26, 2010 11:04 PM

The GetFocusedElement method return the currently focused element during the execution of the method. If the return value is null, it means there is no element is being focused. Perhaps the focus has already been lost or the control is disabled.

Do you mind providing us with a simple runable sample? This way we could try to replicate and analyse the issue further. 

Based on my test using the attached simple sample, the provided suggestion run as intended. The sample page requires some images which you could retrieve from our provided ClientUI sample.


Posted: December 21, 2010 3:50 AM

Based on the documentation, in order to load external XAP you will need to create ApplicationPackage object and and set the source property to the external XAP. It should not matter if it is created by the same developer or not as long as you could set the correct URI to the XAP.

Posted: December 19, 2010 9:27 PM

In the ClientUI control sample, we are downloading another XAP file.

Loading another XAP in SL page is supported in ClientUI, this topic has been discussed in detail in the ClientUI documentation on the article "Application Framework Overview". The article is already available online here.

Posted: December 16, 2010 1:32 AM

Unfortunately, currently our WebGrid report customization is still limited.

I could not found any method to automatically resize the cells to comfort to a paper change.

You could modify the header and date in the PDF report, however there is a predefined size for the date section and setting a different format may result in clipping issue.

In order to escape the HTML character and forcing quote, you could use the Export event handler to modify the exported data. Here is a Expert event handler which modify the header and date when exporting as PDF, and forcing quote in the cell Name when exporting as Text:

protected void wgTest_Export(object sender, ExportEventArgs e)
{
if (e.ReportInfo.ReportType.ToLower() == "pdf")
{
e.ReportInfo.DynReportCaptions.DateCaption = "Date ";
e.ReportInfo.DynReportCaptions.DateCaptionFormat = "yyyy";

e.Table.Caption = "Custom table header";
}
else if (e.ReportInfo.ReportType.ToLower() == "text")
{
for (int i = 0; i < e.Table.Rows.Count; i++)
{
WebGridCell tempCell = e.Table.Rows[i].Cells.GetNamedItem("Name");
tempCell.Text = "'" + tempCell.Text + "'";
}
}
}


Based on the analysis it seems in the MainPage the LayoutRoot Grid split the page into 2 section and the UXDialogBox will be placed in the row with 80px height.

Our suggestion is the LayoutRoot should have no row definition and if you wish to use a row definition. please create a child grid. Here is the snippet:

<Grid x:Name="LayoutRoot">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="386*" />
</Grid.RowDefinitions>
...
</Grid>
</Grid>


Posted: December 10, 2010 5:26 AM

It seems the issue is caused by a bug. I have created a bug report for this issue. If I have any update, I will update the thread.

Posted: December 9, 2010 1:11 AM

Based on my test in a simple sample using the delete snippet in you code, I could not have a NewRow object which has Unmodified state. Could you explain the steps to replicate the issue in the attached sample?

The sample requires Northwind database which has already provided in the WebGrid sample.

All times are GMT -5. The time now is 8:56 PM.
Previous Next