User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: April 6, 2010 12:21 AM

It seems the PagingExportMode="ExportAllData" will not work for self reference grid. I have submitted a bug report for further analysis. We will inform you if there is any update or progress regarding this issue.

Regarding the grouping feature, this is the default behavior. The paging will also take account the grouped row. If the grouped row from a category already reach a page size, the curernt page view will only show a category. The WebGrid already have a property PagingDetectPartialGroupRows under LayoutSettings for you to show some information if the group data could not hold all row in the current page view.

Posted: April 5, 2010 11:18 PM

In the latest build of WebGrid, a new server side function has been added in order to set the paging page from the server side. The function is SetCurrentPageIndex.

You could try using this server side function in order to accomplish your goal.

You could read about FlyPostBack in more detail on the article "How-to: Improve FlyPostBack performance" in the WebUI Framework 3 documentation.

The default setting of FlyPostBack is also discussed in the article.

Posted: April 5, 2010 4:46 AM

From what I understand, you are trying to insert a new custom command in the WebTextEditor floating toolbar.

This custom tool command will hold a WebContextMenu with the XML data specified in your post.

Unfortunately, such scenario has not been supported by WebTextEditor. WebTextEditor only support a single submenu for each command. We already have a sample for such scenario in ToolBar_CustomToolBar.aspx WebTextEditor provided sample.

Based on my discussion with the developer, the error is raised because the page could not found the function, which might be caused by setting the service url incorrectly.

We suggest using similar technique in our WebDesktop sample, SimpleTypeWF.aspx, in which we set the service URL to an external form.


Our control callback is named FlyPostBack. During FlyPostBack, in order to set value you will need to use RenderControl function. Here is an example to set a value during postback for TextBox. Here is the snippet:

TextBox1.Text = "New Value;";
wgTest.ClientAction.RenderControl(TextBox1);

If the suggestion does not solve your issue, do you mind sending us a simple sample of the issue?

The above code will not work because Delete function is a asynchronous call. You will need to modify the code to allow the call to be completed and invoking another delete afterward. Here is the modified snippet:

var i = 0;
var intervalObj;

function DeleteRow()
{
var grid = ISGetObject("grdObj");
var checkedRows = grid.RootTable.GetCheckedRows();
if (checkedRows.length > 0)
{
intervalObj = setInterval(function()
{
if (!grid.IsInProgress)
{
if(i < checkedRows.length)
{
var htmlRow = grid.RootTable.GetCheckedRows()[0];
var wgRowObject = grid.RootTable.ToRowObject(htmlRow);
if (wgRowObject.KeyValue != '')
wgRowObject.Delete();

i++;
}

if (i >= checkedRows.length)
{
clearInterval(intervalObj);
intervalObj = null;
i = 0;
}
}
}, 5);
}
}



Other suggestion would be to hold the value you wish to process in the hidden field during AddRow server side event.

Here is the snippet to set the hidden field during AddRow server side event, in this example the field ID has been known, 5, and the hidden column will have the value "Custom-Val":

HiddenField1.Value = "5;Custom-Val";
wgTest.ClientAction.RenderControl(HiddenField1);

Here is the snippet to retrieve the hidden field during OnAfterAdd client side event:

<script language="javascript" type="text/javascript">
function wgTest_OnAfterAdd(controlId, tblName, rowObject, xmlResponseObject)
{
setTimeout(function()
{
var fieldVal = document.getElementById('HiddenField1').value;
var valComp = fieldVal.split(";");

alert(valComp[0] + " " + valComp[1]);

}, 10);

return true;
}
</script>

Declaration of the hidden field:

<asp:HiddenField ID="HiddenField1" runat="server" />



If the column is not visible, you could try using HiddenDataMember property.

For example you wish to retrieve the Custom field value during AfterAddRow client side event. Here is the snippet of the AfterAddRow client side event handler:

function wgTest_OnAfterAdd(controlId, tblName, rowObject, xmlResponseObject)
{
var wgTest = ISGetObject(controlId);

var rowID = rowObject.Cells.GetNamedItem("ID").Value

setTimeout(function()
{
var tempVal = wgTest.RootTable.GetRowByKeyValue(rowID).GetCell("ID").CellElement.getAttribute("Custom");
alert(tempVal);
}, 10);

return true;
}

Here is the snippet to declare the Custom hidden data member in the column ID:

<ISWebGrid:WebGridColumn Bound="true" EditType="TextBox" Name="ID" DataMember="ID" HiddenDataMember="Custom"></ISWebGrid:WebGridColumn>



As a workaround, you will need to use a column name alias for such column in the SQL command in order for the table adapter generated parameter and WebGrid generated parameter to match.

Another suggestion, would be to convert the parameter to the expected value in the ISDS during deleting and editing server side event. Here is the snippet for the Deleting scenario.

ISDS Deleting server side event for # character:

protected void ISDataSource1_Deleting(object sender, ISNet.WebUI.DataSource.ISDataSourceMethodEventArgs e)
{
e.InputParameters["_Original_Category_"] = e.InputParameters["Original_Category#"];
e.InputParameters.Remove("Original_Category#");
}

ISDS Delete Parameter for # character:

<ISDataSource:ISDataSourceTable DeleteMethod="Delete" InsertMethod="Insert" 
OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData"
TableName="CategoriesPoundSign"
TypeName="CategoriesPoundSignTableAdapters.CategoriesPoundSignTableAdapter"
UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="_Original_Category_" Type="Int32" />
<asp:Parameter Name="Original_Category#" Type="Int32" />
</DeleteParameters>


All times are GMT -5. The time now is 7:39 PM.
Previous Next