User Profile & Activity

Staffan Eriksson Member
Page
of 2
Posted: January 12, 2011 3:42 AM

Just a correction: all of the columns displayed in the WebGrid don't have to be in the update query of the stored procedure. I have many examples when they are not. BUT, all the update parameters also have to be in the query of the select stored procedure which of course makes it almost impossible to create a slimmed and optimized application and database. 

Posted: January 11, 2011 5:21 AM

My scenario is:

I have a select sp which shows many fields. I only allow update in the amount column and I'm using these update parameters:

<UpdateParameters>
<asp:SessionParameter Name="EstateID" SessionField="DropDownList5" DefaultValue="%" />
<asp:Parameter Name="AccountGroup" />
<asp:Parameter Name="Amount" />
<asp:SessionParameter Name="UserID" SessionField="UserID" />
</UpdateParameters>

With WebGrid 6.0 both EstateID and UserID have to be in the select sp otherwise I receive an error message like "The object reference hasn't been set to an instance of an object" (translated from Swedish to English). EditType = NoEdit for all columns except Amount.

With ASP.NET GridView EstateID and UserID doesn't have to be in the select sp and if a column is set to ReadOnly the value is not sent to the datasource when updating.

By the way, it looks like the error message from WebGrid is fired before the OnUpdating server-side event because when I put code in that event it's not run.

Posted: September 27, 2010 5:05 AM

My sp has always looked like this:

DELETE tblCustomer WHERE CustomerID = @CustomerID

I don't see where I can make any adjustments here.

// Staffan

Posted: September 24, 2010 4:53 AM

Hi!

Regarding the first issue: I'm calling a sp "spCustomerDelete". What is the solution then?


I come back with my response after testing your attached sample regarding the second issue.


// Staffan

Posted: February 5, 2010 8:27 AM

Update: it works when setting AllowAddNew through LayoutSettings in the aspx file.

How can it be set from code-behind VB?

// Staffan

Posted: February 5, 2010 6:42 AM

I'm using 6.0.7200.218.


// Staffan

Posted: January 12, 2010 9:35 AM

I'm using this code:

WebGrid1.RootTable.Columns.GetNamedItem("Amount").HeaderStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Right WebGrid1.RootTable.Columns.GetNamedItem(

WebGrid1.RootTable.Columns.GetNamedItem("Amount").CellStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.RightWebGrid1.RootTable.Columns.GetNamedItem("Amount").FooterStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Right

It works ok except that the group footer isn't right aligned, it's still left aligned for some reason. How can I make all rows get right aligned?

// Staffan

Posted: November 17, 2009 3:49 AM

Isn't it possible to set it from code for example OnInitializeRow or at least when exporting to pdf?

// Staffan

Posted: November 11, 2009 5:12 AM

I was invoking export client-side from a button outside the grid. After adding the name of the table the export works.

 

// Staffan

Posted: November 11, 2009 4:16 AM

Perfect, thank you!

All times are GMT -5. The time now is 2:49 AM.
Previous Next