User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: August 27, 2009 1:04 AM

My test show WebGrid does have issue when adding new row with guid column key using BatchUpdate, However the issue is the key value of the guid is clipped so it will only get a few character of the guid not the whole guid. A bug report has been submitted to the developer.

Regarding the issue you are facing, the key is passed as '', after retrieving the dataset you will need to set some property to the datatable, such as primary key, allownull, unless you are already using strongly typed dataset to bind data to WebGrid. 

Posted: August 26, 2009 4:36 AM

In order to support multiple key field scenario you don't need to set the DataKeyField property in the WebGrid table. We already have a sample of this scenario in HierarchicalGrid.aspx. The OrderDetails has multiply key, OrderID and ProductID, so in the OrderDetails WebGrid definition no DataKeyField property is assigned

<ISWebGrid:WebGridTable Caption="Order Details" DataMember="Order Details">

On the other hand, the Order table which has the primary key OrderID will have to be assigned the DataKeyField property

<ISWebGrid:WebGridTable Caption="Orders" DataKeyField="OrderID" DataMember="Orders">


Posted: August 25, 2009 9:59 PM

It's quite odd that it does not work in your environment. In the sample I have also provided an ASP.NET textbox and HTML input text, does this control validation works?

Posted: August 24, 2009 11:23 PM

This issue has been reported previously by another customer and logged as bug #296. Currently the status of this bug is fixed and the fix will be release on SP1.

In order to hide the filterbar you will need to set the FilterBarVisible property to false.

Posted: August 21, 2009 6:20 AM

Unfortunately the script require a class to be assigned to the element you wish to validate, for example
class="validate[required,custom[onlyLetter],length[0,100]]"

In Intersoft control the class could not be assigned by user because Intersoft has internal mechanism that will modify the control style based on state, such as active, over, normal. In order to modify the appearance of Intersoft control you will need to modify the appropriate style.

As James suggested, there is a ways to assign class css attribute in Intersoft control. In WebCombo and WebInput case it could be done by assigning the property TextBoxStyle.Normal.CssClass 

With that new revelation, the validation script does work with IntersoftWebCombo and WebInput.

Edit 8/24/09: Please us the .zip attachment to download the sample 

Posted: August 21, 2009 12:37 AM

Here are the code in your previous post

<asp:Button runat="server" Text="Change Image" OnClientClick="changeImage(); return false;" />

<script type="text/javascript">

function changeImage() {

var grid = ISGetObject('WebGrid1');

var selectedObject = grid.GetSelectedObject();

if (selectedObject != null) {

var selectedRow = selectedObject.ToRowObject();

if (selectedRow.Type == "Record") {

var cells = selectedRow.GetCells();

var ncColumnPhoto = cells.GetNamedItem("ColumnPhoto");

ncColumnPhoto.SetText("images/Anne.jpg");

selectedRow.SetForceNoEdit(true);

selectedRow.GetElement().style.backgroundColor = "LightCyan";

}

}

else {

alert('Please select a row');

}

}

</script>


In order to update image in the column you will need to access the image HTML element and modify the src property.

The SetForceNoEdit function has worked if we already set the Grid to AllowEdit, after changeImage function is invoked the row will not be editable.

In order to change the background color of the row you will need to modify all the TD element background color of all the selected row. 

Here is the updated snippet:

function changeImage() {

var grid = ISGetObject('WebGrid1');
var selectedObject = grid.GetSelectedObject();
if (selectedObject != null) {
var selectedRow = selectedObject.ToRowObject();
if (selectedRow.Type == "Record") {
debugger;
var cells = selectedRow.GetCells();
var ncColumnPhoto = cells.GetNamedItem("ColumnPhoto");
ncColumnPhoto.CellElement.getElementsByTagName('img')[0].src = "images/Anne.jpg";
selectedRow.SetForceNoEdit(true);

var columnList = selectedRow.GetElement().getElementsByTagName('td');

for (var i = 1; i < columnList.length; i ) {
columnList[i].style.backgroundColor = "LightCyan";
}
}
}
else {
alert('Please select a row');
}
}


 


 

 

Posted: August 21, 2009 12:05 AM

We do not have the code for such scenario. However the concept should be similar with BindtoCustomObject.aspx which required you to defined the select method in the ISDataSource. The select method definition, GetCustomers, could be viewed on CustomerDataAccess.cs under AppCode >> GenericObject

Posted: August 20, 2009 9:33 PM

In order to enhance the default Slidebar you will need to add some modification to the slidebar.js, however part of the code in the js is ophuscated which will make it more difficult to enhance slidebar.js than I was previously thought. If possible, you could learn from other custom editor; such as Calculator.js, NumericUpDown.js, and HtmlEditor.js; which has no ophuscation to familiarize yourself with the Custom Editor workings and create your own version of Slidebar.

The currently available resource for CustomEditor are the article titled "Custom Editor Open Architecture" and the CustomEditorTypes.aspx sample in WebGrid sample.

Posted: August 20, 2009 3:12 AM

An article has been provided in WebGrid documentation titled "Custom Editor Open Architecture" which will explain in detail about Custom Editor. The Sliderbar custom editor control javascript code has already been provided in WebGrid >> CustomEditors >> EditorsPack2 in the CommonLibrary folder under your default WebUI installation folder. 

A sample has already been provided to show CustomEditors on WebGrid in CustomEditorTypes.aspx which is available on the installed WebGrid sample

Posted: August 20, 2009 1:06 AM

ISDataSource has already provided a property to define the select function you could use. For this scenario, you could create a new function to select the data from both the SQL Server and Oracle Database and assign it as the select method in the ISDataSource.

All times are GMT -5. The time now is 3:08 PM.
Previous Next