User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: September 2, 2009 3:37 AM

Based on the unophuscated code I attached on CustomEditor thread, the this.OnDropdown function, line #128, will be responsible to show the slidebar and position it on the screen. These are the original lines to position the slidebar:

if (left+width > document.body.offsetWidth)
ddObj.style.left = left - ((left+width) - document.body.offsetWidth) - 50;

if (top+height > document.body.offsetHeight) {
var pTop = top - ((top+height) - document.body.offsetHeight) - 20;
if (pTop < 0) pTop = 25;
ddObj.style.top = pTop;
}

For example if you wanted to always position the slidebar 10px from the left and top of the page, please modify the line above to these lines:

ddObj.style.left = "10px";
ddObj.style.top = "10px";
Posted: September 1, 2009 5:12 AM

Did you handle your own delete and edit method using DeleteRow and UpdateRow server side method?

If you are not using strongly typed dataset to bind data to WebGrid, you will need to set some property to the datatable, such as primary key, allownull to pass the schema to the WebGrid .

Posted: September 1, 2009 2:30 AM

Does this issue is reproducable using the supplied WebGrid sample? for example Filtering.aspx and EnableFiltering.aspx

The only way I could reproduce  the issue, the filter image icon will be left aligned, is when we are using XHTML Doctype. WebGrid currently have not fully supported XHTML Doctype. Please use HTML Doctype to solve this issue. 

Posted: September 1, 2009 12:27 AM

The CustomConditionText will accept any ADO.NET expression. Based on this article on MSDN DataColumn Expression, it seems ADO.NET does not accept Between or NotBetween keyword.

The Between and NotBetween keyword is supported for single column format, for example

ISNet.WebUI.WebGrid.WebGridFormatCondition fmt = new ISNet.WebUI.WebGrid.WebGridFormatCondition();
fmt.Name = "condition4";
fmt.Operator = ISNet.WebUI.WebGrid.ColumnFilterType.Between;
fmt.ColumnMember = "OrderDate";
fmt.ConditionText = "7/1/1996 and 7/18/1996";
fmt.TargetObject = ISNet.WebUI.WebGrid.TargetObjectType.Row;
fmt.FormatStyle.Font.Bold = true;
fmt.FormatStyle.ForeColor = System.Drawing.Color.Green;
fmt.Enabled = true;

WebGrid1.RootTable.FormatConditions.Add(fmt);

The syntax will be similar for NotBetween operation

 

This issue only occurs if we are using Slidebar in XHTML Doctype page. Currently Slidebar only support HTML Doctype. Please use HTML Doctype if you are using Slidebar custom editor.

Posted: August 30, 2009 10:33 PM

The request for the unophuscated code has been approved. Attached is the unophuscated code of Slidebar.js. The code for sliderbar event binding and element creation is in the SlidebarEngine._Initialize function, line #1025.

Posted: August 30, 2009 10:03 PM

Just quoting from my response in Multiple Datakey Fields thread

Inorder to support multiple key field scenario you don't need toset 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 30, 2009 10:00 PM

Just quoting from my response earlier

In order to support multiple key field scenario you don't need toset 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 28, 2009 5:50 AM

In order to define you own column to display you need to implement the PrepareDataBinding event handler and define the WebGrid table column you wish to display. In most of the Intersoft provided sample, the column generation is using RetrieveStructure function to auto generate the column based on the binded data schema.

Here is the snippet to show certain column of the datasource, for this example we would like to show column id, firstname, lastname, and value:

protected void grdObj_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
if (!Page.IsPostBack )
{
WebGridColumn wgColID = new WebGridColumn();
wgColID.Caption = "ID";
wgColID.DataMember = "id";
wgColID.Name = "id";
wgColID.Width = Unit.Pixel(150);
grdObj.RootTable.Columns.Add(wgColID);

WebGridColumn wgColFirstName = new WebGridColumn();
wgColFirstName.Caption = "First Name";
wgColFirstName.DataMember = "firstname";
wgColFirstName.Name = "firstname";
wgColFirstName.Width = Unit.Pixel(250);
grdObj.RootTable.Columns.Add(wgColFirstName);

WebGridColumn wgColLastName = new WebGridColumn();
wgColLastName.Caption = "Last Name";
wgColLastName.DataMember = "lastname";
wgColLastName.Name = "lastname";
wgColLastName.Width = Unit.Pixel(250);
grdObj.RootTable.Columns.Add(wgColLastName);

WebGridColumn wgColValue = new WebGridColumn();
wgColValue.Caption = "Value";
wgColValue.DataMember = "value";
wgColValue.Name = "value";
wgColValue.Width = Unit.Pixel(150);
wgColValue.DataType = "System.Int32";
grdObj.RootTable.Columns.Add(wgColValue);
}
}


 

Posted: August 27, 2009 3:50 AM

In the current release of WebGrid there is some feature which has not been supported and unfortunately HierarchicalGrid in ClientBinding is one of them. This feature is planned for future release of WebGrid.

Quoting from the WebGrid whitepaper:

The following features are not supported in version 7, although the architecture has been properly designed to support implementation for those features in the next version:
  • Hierarchical Grid (Child Tables)
  • Self Referencing

 

The full feature and limitations of WebGrid client binding feature could be read in WebGrid Whitepaper under the subtitle Supported Features and Limitations

All times are GMT -5. The time now is 1:54 PM.
Previous Next