iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I'm using WebGrid with LinqDatasource that uses On_Selecting with a stored procedure. I've noticed that that the On_selecting method is called before the user can set the parameters.
What i want is the screen to load, the user sets the search parameter fields using WebInputs, WebCombos, checkboxes etc and then clicks a WebButton. If I put a breakpoint at the On_selecting method i can see that it is called before any button is clicked. Also, the value of the checkbox is not picked up. It is always false.
George
I’d like to suggest you to use “RebindDataSource()” method on WebButton click event in order to get the OnSelecting event of LinqDataSource control get invoked after WebButton is clicked.
For the value of the checkbox is not picked up and always false issue, please try to set the “PostInputControls” property of “FlyPostBackSettings” of WebButton to true, as seen below.
<ISWebDesktop:WebButton ID="WebButton2" runat="server" Height="20px" PostBackMode="FlyPostBack" AutoPostback="true" OnClicked="WebButton1_Clicked"> <FlyPostBackSettings PostInputControls="true" /> </ISWebDesktop:WebButton>
This should helps.
Yudi
I have no problem getting the WebButton click event to work. It's that when the page loads the LinqDataSource_OnSelecting fires. This select is totally useless since the webGrid won't be displayed until the WebButton is clicked and the data retrieved has no meaning to the user.
i think i have PostInputControls = true but i'll check again.
George.
This is default behavior of ASP.NET data source control life cycle.In .NET life cycle, all data binding process will run first, and then followed by other event, in this case WebButton1_Clicked event.
Is that true? I don't see this happening with VS controls. If it didthen everytime a page loaded that had a control (e.g. GridView) it would load. This could cause a serious delay as the GridView is loaded with maybe millions of useless records.
Yes, you are correct. Sorry for my mistake in my previous post.
When I bind WebGrid with LinqDataSource, the “OnSelecting” server side event of LinqDataSource will invoked first and then followed by the “ButtonClick” event of WebButton. When I tried to bind GridView with LinqDataSource, the “ButtonClick” event of WebButton will come first and then followed by the “OnSelecting” server side event. this behavior is the default behavior of WebGrid.
It seems that you would like to bind WebGrid after postback. If it does, then your scenario will be suitable with late binding scenario.
Hope this help.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname