User Profile & Activity

Glenn Layaar Support
Page
of 99

Unfortunately, currently WebTreeView have not support such feature.

The current support for WebTreeView load on demand could be viewed on BasicLoadOnDemand.aspx. The sample show how to load child node using load on demand scenario initially. 

Posted: March 15, 2010 1:13 AM

Attached is the solution proposed by Julia, using WebDialogBox as confirmation and calling click event handler for the confirm button in the WebDialogBox.

In the next build of WebScheduler which will be released in a few weeks. The View On My Calender link will automatically be hidden if the DayView is disabled. You do not need to manually set AgendaView -> DIsplayViewOnMyCalander link to false if DayView is false.

The next build of WebGrid 7 will be released in a few weeks which already include this feature. The method to bound Hierachical LINQ DataSource to WebGrid will be similar to the WebGrid documentation article "Outbound Mode".

Here is the snippet for InitializeDataSource and PreInitialize event handler for Northwind data:
protected void wgTest_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
NorthwindV2DataContext northwind = new NorthwindV2DataContext();

var query = from c in northwind.Customers
select c;

e.DataSource = query.ToList();

}
protected void wgTest_PreInitialize(object sender, EventArgs e)
{
NorthwindV2DataContext northwindContenxt = new NorthwindV2DataContext();

// assign OnPreInitialize event in ASPX
// defines the Object Relations
ArrayList objectRelations = new ArrayList();
objectRelations.Add(new WebGridObjectRelation(
typeof(List<Customer>), "CustomerID", "Orders",
typeof(List<Order>), "CustomerID"));

// defines the Parent and Child Type information
// objectTypes contains 3 object array: The parent collection type,
// child item type, the primary keys of child collection
// Primary keys can be string (if only 1 primary key defined),
// or array of string for multiple primary keys scenario.
ArrayList objectTypes = new ArrayList();
objectTypes.Add(new object[] {
typeof(List<Customer>), typeof(Customer), "CustomerID"});
objectTypes.Add(new object[] {
typeof(List<Order>), typeof(Order), "OrderID"});

// assign the required definitions through SetObjectRelations method
// the SetObjectRelations need to be called in new PreInitialize method
// since it needs to be initialized in earliest phase.
wgTest.SetObjectRelations(objectRelations, objectTypes);

}



The next build of WebGrid 7 will support this feature which will be released in a few weeks. Here is a snippet of the GetData function:

[WebMethod]
public Object GetData(DataSourceSelectArguments selectArguments)
{
SqlCommand retrieveComm = new SqlCommand();

retrieveComm.Connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlNorthwindConnectionString"].ConnectionString);

retrieveComm.CommandText = "SELECT TOP 15 * FROM [Products]";

SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = retrieveComm;

DataTable dtTemp = new DataTable();
da.Fill(dtTemp);

if (selectArguments.OperationType == SelectOperation.SelectData)
{
ISDataTable isTable = DataTableConverter.ConvertFrom(dtTemp);
return isTable;
}
else if (selectArguments.OperationType == SelectOperation.SelectCount)
return dtTemp.Rows.Count;

throw new InvalidOperationException("Unsupported operation type!");
}

Here is the snippet of the WebGrid client binding property:

<ClientBindingSettings DataLoadMode="PagedData" DataSourceType="WebService"
ServiceUrl="CustomService.asmx">
<ServiceMethods SelectMethod="GetData" />
</ClientBindingSettings>

It is very similar with the snippet code you posted

Posted: March 14, 2010 10:37 PM

Here is the link the the nightly build, WebInput

As with the usual nightly build, this build is intended for testing purpose only in order to verify the issue you reported has been corrected. Some issue and instability should be expected in using nightly build.
Posted: March 12, 2010 5:54 AM

Based on the discussion with our developer, he will need to view the source file of the page to further investigate the issue. Please attach the view source result of the problematic page. If the requested information contains sensitive information please send it through technical@intersoftpt.com

You could use the ISDataSource selected event handler to buffer rows count of the selecting query retrun value object. The ISDataSource selected event will be triggered before WebGrid OnAddRow and OnDeleteRow.  

Here is the snippet to buffer the rows count of Customers table:

protected void ISDataSource1_Selected(object sender, ISNet.WebUI.DataSource.ISDataSourceStatusEventArgs e)
{
if (((DataTable)e.ReturnValue).TableName == "Customers")
{
rowCount = ((DataTable)e.ReturnValue).Rows.Count;
}
}


Posted: March 11, 2010 10:04 PM

We have a GoToPage and GoToFirstPage in the WebGrid 6 client side function in order to set the WebGrid to a certain page in a classic paging scenario. Here is the snippet if you would like to move to the first page, you could use the GoToPage or the GoToFirstPage to achieve the desired result:

var grid = ISGetObject('WebGrid1');

grid.GotoPage(1);
grid.GotoFirstPage();

You could try to use the SetTimeOut javascript function for the GoToPage call in order to delay the function execution in the AfterResponseProcess.

Posted: March 11, 2010 9:58 PM

We have a GoToPage and GoToFirstPage in the WebGrid 6 client side function in order to set the WebGrid to a certain page in a classic paging scenario. Here is the snippet if you would like to move to the first page, you could use the GoToPage or the GoToFirstPage to achieve the desired result: 

var grid = ISGetObject('WebGrid1');

grid.GotoPage(1);
grid.GotoFirstPage();


All times are GMT -5. The time now is 6:26 AM.
Previous Next