Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting up FK columns in Web DataGrids
Message
From
17/03/2004 11:41:28
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00886350
Message ID:
00887115
Views:
10
Kevin,

>
>When you say it didn't work, did you get an error or it just didn't bind? Does it work if you use a regular combo box?
>

The answer to question 1 is both. Adding the MM textbox control to the column template causes the following exception;
[HttpException (0x80004005): A control cannot modify its parents' control collections.]
   System.Web.UI.ControlCollection.RemoveAt(Int32 index)
   System.Web.UI.ControlCollection.Clear()
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
   System.Web.UI.WebControls.BaseDataList.DataBind()
   OakLeaf.MM.Main.Web.UI.WebControls.mmDataGrid.BindControlToData(DataSet ds, String tableName)
   OakLeaf.MM.Main.Web.UI.mmWebBindingStrategyDataGrid.BindData(ImmWebBindingDataGrid mmGrid, mmBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e)
   OakLeaf.MM.Main.Web.UI.WebControls.mmDataGrid.OnBindData(mmBusinessObject bindingSource, mmBusinessStateChangeEventArgs e, Boolean bindBack)
   OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.BindControl(ImmWebBinding control, String bindingSource, String bindingMember)
   OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.OnBubbleEvent(Object source, EventArgs e)
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   OakLeaf.MM.Main.Web.UI.WebControls.mmDataGrid.OnBubbleEvent(Object source, EventArgs e)
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()
After further consideration, I decided to bag the textbox idea and modify my SELECT to pull in the friendly name value and use the .Net default label control in the template. So, I've got the display working just fine at this point.

Moving on to the edit, the dropdown did not populate even though it was bound to the BO. No errors, but no data either.

The answer to question 2 is yes. Yes, I can build a template column using regular .Net controls and handle the data binding and updating using custom code. I'm implementing some code from examples in Scott Mitchell's execellent reference on the DataGrid, DataList and Repeater controls. The technique is in there, and while it's quite doable, it's not exactly RAD.
<mild rant on>
I'm curious as to why there is no topic in the Dev Guide concerning this. The quickstart is fine as far as it goes, but without examples of dropdown and checkbox implementations it's rather simplistic, no offense intended Kevin. I really do admire your prowess and expertise with .Net. But, I'm left wondering why if an example of editing in a datagrid is included, why a fairly common scenerio of implementing FK columns and checkboxes is not. I'm left wondering if the MM framework has more to offer in regards to this topic than I see at the moment. From your response, I'm not sure that it does, which is OK, but a little disappointing. I'm hoping that I'm actually off base here and that I just don't understand how to tap into it, but...an example or updated Dev Guide Topic would be of great value to the newbies like me. At this point my implementation is plain .Net.
</mild rant off>
Thanks!
Kendall Webb
Senior Software Engineer
MCAD.Net/MCSD.Net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform