02-05-2010 08:52 AM
I'm populating a grid and wanted to also resize the first two columns so they don't wrap their contents, so in my BR I passed the DataGrid as a param and then do this
grd.datasource = ..... (IList);
System.Web.UI.WebControls.GridView grd2 = (System.Web.UI.WebControls.GridView)grd.NativeControl;grd2.Columns.ItemStyle.Width = new System.Web.UI.WebControls.Unit(2500,System.Web.UI.WebControls.UnitType.Pixel);
grd2.Columns.ItemStyle.Width = new System.Web.UI.WebControls.Unit(2500,System.Web.UI.WebControls.UnitType.Pixel);
But the columns keep sizing based on the Header length. Any ideas on how can I prevent that????
I copied and pasted a button from one form to another. I received an error, I removed the button, It removed the script associated with it in the ORIGINAL FORM!!!!!!!
more to come....
02-05-2010 02:50 PM
02-08-2010 11:18 AM
Hi Eugenio -
Sorry, this is a bit of a tangent but thought it is a relevant thread to discuss opinions.
You mention that you used a BR (Business Rule) to implement your solution by passing a reference to the grid, etc. into the BR.
I believe the guidance from the product is that BRs should not act on any U.I. and should be constrained to acting on the Entity, the Current User, and any other Entity objects. U.I. logic should be implemented in CodeSnippets or in external assemblies. The objective being to achieve as clean as possible division between Data/Entity layer and U.I. layer.
I've always followed that separation. Eugenio, you have always done interesting and sophisticated customizations with all SLX products including the SLX Webclient so am very interested in your opinion and observations as well as anyone else following this thread.
02-13-2010 09:39 AM
I was discussing the same topic with RJLedger earlier this week. He mentioned that you the same thing.
The truth being the matter is I could have done it in the UI snippets, but then I had to copy (and maintain) 6 times the same code, as the same grid logic is used in 6 different tabs, being the only differences if the tab is under Account, Contact or Opportunity, the grid names, etc.
Being that said, following Ryan Farley's techniques of casting SLX Web Controls as their Web UI .NET counterpart you can actually process controls anywhere, from the snippets to the internal BRs, as long as you pass that object when you call the BR.
Although I recommend following whatever conventional standards have been adopted, I don't see any problems or restrictions (except for "Design Guidelines") as why you would not be able to pass any object into a BR and cast it as the Equivalent Web Control it represents.
And if we want to get really really picky about the separation between UI and BRs in the backend, all the UI development of the web client should have been done with JQuery, and using AJAX/SData to retrieve and store data. (JQuery has beautiful visual themes very easy to implement - for example, for starters you could have dialogs upon dialogs upon dialogs, plus a lot of stuff that you could never achieve using .NET web controls -
02-16-2010 04:02 PM
I am a big fan of the JQuery/ExtJS/SData concept. Would be fantastic to see that happen.
For re-use of U.I. code, my current preferences are (in this order) :
None of this is a direct argument against using an Entity BR of course, but for the time being I am going to see where I can get to without doing any U.I. manipulation in BRs.