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 have a WebGrid which has two checkbox columns ( so I can't use the DataRowChecker as that is to select a row and only works with one checkbox). I did the obvious, created 2 columns with ColumnType CheckBox and bound them to my datasource (booleans for each column). The problem is that when I do a postback (after selecting some of the checkboxes and hitting the Save button), the RootTable is empty (no rows) in the PageLoad event. Why is the state of the RootTable not posting to the server?!! In this case, how I am supposed to handle a Save event when there is no way to know what was checked by the user. Please do not tell me to use IsRowChecker, that is not a solution when you have more than one checkbox.
Hello,Basically, the reason why we can’t get the row/data from WebGrid, due to the WebGrid hasn’t load/render the row/data. It doesn’t have relation with the number of checkbox.However you could get the data of WebGrid from the button’s OnClick event.I made a simple WebGrid sample based on your information.I bind WebGrid to access data source (Northwind.mdb database and Products table). But I made a little change in the Products table; I add one more (Boolean) column, named Discontinued2.Now I have WebGrid with two checkboxes column.In Button1_Click server side event, I add some code to get the value from Discontinued column and Discontinued2 column.Please have review on my sample and please let know your response.Regards,Hans.
This is still not working for me....what version of the WebGrid are you using? We are still on Version 6. Could that be the issue?
Hello Micahel,
Have you seen Han's sample? I am not sure if his current sample reflects your current condition. So, you better help us by modifying the sample so it can replicate the issue. Regarding your scenario it should use boolean database that represet as checkbox in grid.As you said before, you want to save it into database when clicking a button. So, does that mean that all changes would be saved by using button and no a single process is handled by WebGrid?
Also, since all the checkboxes changes would be saved into database, then to know how many checkboxes that are checked, then you should handle them by yourselft. Example, by using some queries that would select the rows when the checkboxes field is true/1.Our GetCheckedRows() method can only be used for IsRowChecker.When it comes to RootTable empty after postback in page load, I think there must be something wrong with your binding.Please confirm how do you do the binding. FYI, the binding should be used in IntializeDataSource instead of PageLoad.
Regards,Handy
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