WebBusinessBindingSource and method add


Author
Message
Olivier
Olivier
StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Hello,

I use the Telerik RadGrid for a long times , only readonly view.

I have a question about a good way, my grid is link with WebBusinessBindingsource
and it's work very well.

I have a button in my WebForm to Add a record, when i start
This.MyBo.Add()
This.MyRadGrid.Databind();

The grid contain my old Fill Data on my Businessobject.

How can i get a empty grid when i want to add a record.

i hope to be explain.

Thanks
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Edited 11 Years Ago by Olivier
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Are you wanting to only show that 1 empty row when you're adding a new record?  If so, you will need to call this.MyBO.Clear() before you call the Add().  If this.MyBO has a static backing field, then it's probably already filled with data on the post back.
Olivier
Olivier
StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Hello Ben,

It's really strange, cause i fill
in the page_load and i use ! Page.IsPostBack

if (! Page.IsPostBack) {
   LoadDetail(Convert.ToInt32(cMAN_ID));
   this.SetButtonState();
}


in my button New i had already clear before add()

and before add i same put this :  this.MyBo.MyCustomFillData("myfield","man_id=-1");
to get no record.

Have you an another idea ?

thanks
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If the business object is on the ApplicationBasePage, then it's stored in a session variable, so as soon as possible during the load, the business object is pulled from the session variable, so it's not a new business object on each page load.  If you put a clear at the top of the load, then do an Add() in an event handler, then it's possible you're clearing the business object, then it's set back to the one stored in the session variable, then the event handler is called.  

You might have to put Clear() at the very top of the event handler that is calling your Add().
Olivier
Olivier
StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Hello Ben,

i try to find a solution and i come back to tell you.

I have a question about Bo store in session variable,

if my user let the browser during a call for 20 minutes in editing state,
strata lose information when the user want to validate this.

I know the user still too long, but it's happen like this.

Have you an idea to test if the Session use with strata are expired, to reload data in memory ?

thanks
OLivier

==============================================
Asp.net C# - Strataframe - telerik
==============================================
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Hrm, Olivier, I don't think there is a pretty way to handle the continuing of a session if the user lets the session time out.  

You could increase the session timeout in IIS to more than 20 minutes.  In the page load, if the user tries to validate some data and the business object is empty, you know that the session has timed out and you can show a message to the user that tells them their session has timed out and they need to not wait so long before trying to validate the data.

Or, you could create you're own session tracking for this data by logging it to SQL Server.  You would just need to log, by user, what business object they are editing and the primary key.  Then, at the top of the page load, if the user has an editing log record, and the requested business object is empty, you would repopulate the business object.
Olivier
Olivier
StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Hello Ben,

It's not a good way to increase a session timeout on the web, cause the server lose a lot of ressources.

On the most of the website, you can see a checkbox on the bottom of the login, it add a cookie session, which it can
to reload a session when it's timeout.

it's a best tip  to keep alive the front iis server (and apache or other).


I reload the session on the appbasepage, i will re think the way , to reload so the business object.
with your idea to repopulate the business object.

thanks for your help.
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search