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 dropdownlist column which is bound to a foreign key column and populates its data from another LinqDataSource.To add "null" selection option for that column, i'm inserting a null object to the first position of returned object list during LinqDataSource_OnSelected event [ ((IList)e.Result).Insert(0, null); ]. This seems fine for having "null" selection option for that column. But when posting update with batchupdate it is giving error, as batchupdate sending empty string instead of null for that column.How can i solve this?
I tried to reproduce the problem in my local test by creating a simple sample of BatchUpdate-enabled WebGrid where one of its columns uses DropDownList as the edit type. The data source of the DropDownList is taken from a database where the first row is a null selection option. The only difference is that AccessDataSource control is used instead of LinqDataSource control. Everything worked smoothly and the null value can be saved without any issues.
I’m willing to advice you further but in order to do so we would need you to elaborate on your specific scenario and possibly give us a running simple sample that reproduce the issue and a step-by-step guide that we can use to observe the problematic behavior.
Yudi,The problem is dropdown's original datasource has no null row, but i want to add it to dropdown list.Sample Scenerio is:Webgrid's boundend datasource is a customer table where its country field is a nullable foreign key field. So what i want is a country dropdownlist column which populates its data from country table. But also, as it is nullable field, i have to supply a null option for that field. As you may agree, it is not an option to add a null row to country table. So i'm inserting a null object to returned collection at OnSelected event of LinqDataSource.In my opinion, as this scenerio is very generic, there must be a simple option for this in webgrid column.
Could you please kindly send us a working simple sample that reproduces the issue?
Sample is attached; sample database is in data folder of compressed file.
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