Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmDropDownList data binding
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01250814
Message ID:
01253191
Views:
20
I have a suggestion for BindControl(ImmWebBinding control, string bindingSource, string bindingMember)

Change code:
                    // See if the business object contains the table this control is bound to
                    if (DataTableName != "" && ds.Tables.Contains(DataTableName))
                    {
                        // Tell the control to bind
                        control.OnBindData(BizObj,
                            new mmBusinessStateChangeEventArgs(
                            mmBusinessState.Bind,
                            DataTableName,
                            BizObj.GetPrimaryKeyValue(),
                            BizObj.GetPrimaryKeyValues()), bindBack);
                    }
to
                    // see if we bind back
                    bool bindBack = false;
                    if (control.IsPostBack && control.BindOnPostBack)
                    {
                        bindBack = true;
                    }

                    // See if the business object contains the table this control is bound to
                    if (DataTableName != "" && ds.Tables.Contains(DataTableName))
                    {
                        // Tell the control to bind
                        control.OnBindData(BizObj,
                            new mmBusinessStateChangeEventArgs(
                            mmBusinessState.Bind,
                            DataTableName,
                            BizObj.GetPrimaryKeyValue(),
                            BizObj.GetPrimaryKeyValues()), bindBack);
                    }
I think that it's a little more human readable than just
                        // Tell the control to bind
                        control.OnBindData(BizObj,
                            new mmBusinessStateChangeEventArgs(
                            mmBusinessState.Bind,
                            DataTableName,
                            BizObj.GetPrimaryKeyValue(),
                            BizObj.GetPrimaryKeyValues()), control.IsPostBack && control.BindOnPostBack);
Please let me know if you see any problems with this. Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform