I find it ironic that all of your samples use dynamic SQL or TABLE attached data.
In the real world no DBA will allow direct access to sensitive data like orders and customers. The typical approach will be to build and use stored procedures that can be granted to groups or individual users to control the data access.
Nowhere do I find any samples of using stored procedures to return a subset of data from a data table, edit the data and return it via stored procedures. We will not recommend this product unless I can build a prototype with this architecture. I've done it in the past with your competitor's grid...how do I do it with this one?
dhouse@amcon.com
Hi Dave,
Our samples use inline SQL because we try to keep them as simple as possible, we do not recommend that approach for real world applications. The purpose is to demonstrate how to configure our data grid, stored procedures and n-tier architectures are beyond the scope of the samples.
Anyway there shouldn't be any issues in using stored procedures for your CRUD operations. You just execute stored procedures instead of embedded SQL, and most probably you do that in the backend of your application instead of the code-behind. If you are experiencing any particular issues with such approach we'll be glad to help you. Any feedback is highly appreciated!
Thank you for evaluating our products!
Here is where we are:
I have data displayed in the grid using stored procedure call from the data access layer...
I have only one column set up to be editable (by the way, your property to allowedit is logical backwards...must be set to False in order for the column to be editable (UltraWebGrid).
The user can edit the column on any row in the page, and the value displays correctly on the page.
When the save button is pressed, the code behind walks through the rows of the grid with the following code:
Dim success As Boolean = False
For Each row As UltraGridRow In uwgOpenOrders.Rows
Dim pendItemID As Integer = CInt(row.Cells(col.PendItemID).Value)
Dim qty As Integer = CInt(row.Cells(col.Quantity).Value)
Try
success = PendOrderItemCtrl.UpdateItemQuantity(pendItemID, qty)
Catch ex As Exception
... exceptions logged to db here...
End Try
Next
When we evaluate the Qty variable on the first edited row (row one in the grid for this test) the value is always the value from the database, not from the cell that was edited...
The Properties of the Cell are as follows:
row.Cells(col.Quantity) {Infragistics.WebUI.UltraWebGrid.UltraGridCell}
Activated False
AllowEditing NotSet {0}
Band {Infragistics.WebUI.UltraWebGrid.UltraGridBand}
ColSpan 1
Column {Infragistics.WebUI.UltraWebGrid.UltraGridColumn}
DataChanged False
HasStyle True
Key "Quantity"
Row {Infragistics.WebUI.UltraWebGrid.UltraGridRow}
RowSpan 1
Selected False
Style {Infragistics.WebUI.UltraWebGrid.GridItemStyle}
Tag Nothing
TargetURL Nothing
Text "1"
Title Nothing
TitleMode NotSet {0}
Value 1 {Integer}
I have Bolded the items that I thought would have changed...
What settings on the grid are required to make the altered data available to the server?
This is strange, what version of NetAdvantage you are using?
NetAdvantage_ASPNET_20083_CLR35.exe
This looks like you're using WebGrid (class name Infragistics.WebUI.UltraWebGrid.UltraWebGrid), rather than WebDataGrid (class name Infragistics.Web.UI.GridControls.WebDataGrid).
Can you confirm? If so, I'll move this post to the WebGrid forum (it's currently in the WebDataGrid forum).
I changed the grid from the UltraWebGrid to the WebDataGrid...
Now when I load the grid with data from a datatable, I cannot alter the columns, as they do not exist...
WebDataGrid1.DataSource = dtLabels
WebDataGrid1.DataBind()
.Columns("PriceLabelID").Width = 0
.Columns("Selected").Width = 20
.Columns("Selected").Header.Text = "Sel"
.Columns("BranchNo").Width = 0
.Columns("UPCNumber").Width = 90
.Columns("Retail").Width = 40
.Columns("ItemDescription").Header.Text = "Description"
.Columns("SellRatio").Width = 40
.Columns("Source").Width = 0
End With
'Stop
Columns.Count in the WebDataGrid1 object is 0...
Read one of the other column related posts, and tried what was suggested...Building BoundDataField objects, setting properties, and then adding them to the Grid.Columns collection.
Kinda works, but not exactly...Don't want to display some columns, but need the data to do updates, like the rowID field. Setting it's width to ZERO does NOT remove the column. It defaults to a value of approx 5.
Also, how do you force a column to use a checkbox as it's edit control. I have a boolean column (SQL Bit DataType) but is shows as "false" in the grid.
Also, how do you flag certain columns as ReadOnly...
Would be really nice if you produced some type of documentation for this stuff...much faster to search online help files than wait for a forum response...