User Profile & Activity

Glenn Layaar Support
Page
of 99

The issue has been discussed further in Live Chat. Since the goal is to modify the ability to enable or disable edit of a row or cell, using client side event handler OnAfterInitialize is possible to achieve such feature.

The client side function to disable edit is SetForceNoEdit(true), which could be applied to WebGrid cell object or WebGrid row object. Here is the snippet to disable first row in WebGrid and column Author in second row of WebGrid:

grid.RootTable.GetRow(0).SetForceNoEdit(true);

grid.RootTable.GetRow(1).GetCell('Author').SetForceNoEdit(true);


Unfortunately, LoadContentFromFile emthod will not be able to modify the image path.

One suggestion for such scenario, would be to modify the image path programatically, most likely using regular expression, and assign the modified file content to the WebTextEditor using RootTextEditor.Content property.

Such behavior also occur in our test, I have create a note to discuss this issue further with the developer regarding the expected behavior under such condition.

In the mean time, if you would like the newly created event for unselected resource to be hidden after an add operation, you coud invoke the refresh method during OnAfterAdd WebScheduler client side event:

function WebScheduler1_OnAfterAdd(ctrlId)
{
setTimeout(function()
{
var sched = ISGetObject(ctrlId);
sched.Refresh();
}, 500);
}


If you could not publicly post the video you could sent it to technical@intersoftpt.com and reference this thread.

Please send the video or any image if available as an attachment.

It will also be very helpful if you could modify the simple sample so it could replicate the issue in your scenario.

Posted: April 20, 2010 10:49 PM

You coud use the OnEditorContextMenu client side event handler for such scenario as detailed in WebTextEditor documentation on the article "How-to: Add Item in Context Menu"

Here is the snippet for your scenario:

function WebTextEditor1_OnEditorContextMenu(controlId, menuObj)
{
var items = menuObj.RootMenu.Items;
if (items.GetNamedItem("vCustom") == null)
{
items.Add(new WebMenuSeparatorItem());
var vCustomItem = new WebMenuItem("vCustom", "vCustomer", null, OnClickItemContext)

vCustomItem.Items.Add(new WebMenuItem("vcFirstName", "FirstName", null, OnClickItemContext));
vCustomItem.Items.Add(new WebMenuItem("vcLastName", "LastName", null, OnClickItemContext));
vCustomItem.Items.Add(new WebMenuItem("vcAddress", "Address", null, OnClickItemContext));
vCustomItem.Items.Add(new WebMenuItem("vcPhone", "Phone", null, OnClickItemContext));

items.Add(vCustomItem);
}
}

function OnClickItemContext(menuItem)
{
var rte = ISGetObject("WebTextEditor1");

var keyword = {
vcFirstName: "vCustomer.FirstName",
vcLastName: "vCustomer.LastName",
vcAddress: "vCustomer.Address",
vcPhone: "vCustomer.Phone"
};

setTimeout(function()
{
rte.SetValueToCurrentPosition(keyword[menuItem.Name]);
}, 500);
}



Posted: April 20, 2010 12:08 AM
 Unfortunately, such ability is currently not supported in WebCoverFlow.

In order to change the data source in during runtime in WebCoverFlow ASP .Net you will need to bind the data during page load server side event.

Attached is a simple page sample which demonstrate displaying different data source based on button click. The sample is using Products_MobilePhones.mdb database from the WebGrid provided sample, the images referenced in the table is available under products folder in the WebGrid provided sample.

Posted: April 19, 2010 10:37 PM

The fix is still being analyze as the issue is still open. In the meantime, as a workaround you could try invoking a client script event in order to modify the input forecolor on the server side.

Here is the snippet of the client side function, setting the forecolor is done by adding a new css class which has the style you wish to add:

<style type="text/css">
.RedText
{
color: Red !important;
}
</style>
<script type="text/javascript" language="javascript">
function SetColor()
{
var input = ISGetObject('WebInput1');

input.GetControlElement().className += " RedText";
}
</script>

The server side function to invoke the SetColor function:

Page.ClientScript.RegisterStartupScript(this.GetType(), "SetColor", "<script>SetColor();</script>");


Posted: April 19, 2010 3:31 AM

Thank you for the sample an steps to replicate the issue. Using the attached sample in our environment, I could replicate the issue.

A bug report has been submitted to the developer. We will inform you if there is any update / progress regarding this issue.

If you do not define the child table, during PrepareDataBinding WebGrid event handler you will need to create the child table and child table column structure and reset the hierarchical property under LayoutSettings.

Here is the snippet for the PrepareDataBinding event for the sent sample with your scenario applied:

protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
if(!Page.IsPostBack)
{
WebGrid1.RootTable.ChildTables.Add("Order");

WebGridTable orderTbl = WebGrid1.RootTable.ChildTables[0];
orderTbl.DataMember = "Order";
orderTbl.Columns.AddRange(new WebGridColumn[] {
new WebGridColumn("OrderID","OrderID","OrderID"),
new WebGridColumn("CustomerID","CustomerID","CustomerID"),
new WebGridColumn("OrderName","OrderName","Name"),
new WebGridColumn("OrderQuantity","OrderQuantity","Quantity"),
});
}

WebGrid1.LayoutSettings.Hierarchical = true;
}

The WebGrid RootTable definition:

<RootTable DataMember="Customer" DataKeyField="CustomerID">
<Columns>
<ISWebGrid:WebGridColumn DataMember="CustomerID" Name="ID"></ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn DataMember="CustomerName" Name="Name"></ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn DataMember="CustomerAddress" Name="Address"></ISWebGrid:WebGridColumn>
</Columns>
</RootTable>


Do you mind elaborating on the WebGrid setting you are using?

In my test using simple flat grid, I did not encounter the error you mentioned. Attached is the sample page used in my testing, feel free to modify it to reflect the WebGrid setting you are using.

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