dingjing

MVP Developer
Registered: 02/28/06 Posts: 1,634
|
|
Posted 08/06/10 at 06:24 PM
|
Reply with quote
#1
|
|
|
Highlight a table row with one line of code
Keywords: TableControl, highlight, conditional
|
|
Loading...
|
|
mhweiss

MVP Consultant
Registered: 08/29/05 Posts: 1,761
|
|
Posted 08/08/10 at 06:13 PM
|
Reply with quote
#2
|
|
Thank you! This is great and will be very useful... Michael
__________________ michael@occasiosystems.com
http://www.occasiosystems.com
|
|
Loading...
|
|
Tooth
Registered: 10/10/06 Posts: 68
|
|
Posted 08/17/10 at 02:02 PM
|
Reply with quote
#3
|
|
Thanks from me too
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 08/23/10 at 06:46 AM
|
Reply with quote
#4
|
|
Help . .
Thought I'd try this out in the preparation of a new application and for the reasons above plus the css entries for colour are great.
Followed the intructions OK (I thought) and figured most things outs but the compilation fails in the BaseApplicationRecordControl with Compiler Error Message: BC30456: 'OfType' is not a member of 'System.Web.UI.ControlCollection'.Code: Imports BaseClasses
Imports BaseClasses.Data
Imports BaseClasses.Utils
Imports BaseClasses.Utils.StringUtils
Namespace ProductionBuilds.UIPublic
Class BaseApplicationRecordControl
Inherits System.Web.UI.Control
'*******************************************
'
'*******************************************
Public Sub SetRowAppearance(cssName As String)
Dim ctrl As WebControl = Controls.OfType(Of WebControl)().Where(Function(c) Not (TypeOf c Is Literal) AndAlso c.Visible).First()
Dim script As String = String.Format("$('td', $('#{0}').closest('tr')).addClass('{1}');", ctrl.ClientID, cssName)
ScriptManager.RegisterStartupScript(Me, [GetType](), ClientID, script, True)
End Sub
'******************************************* Should there be some other Imports or have I missed something here? This looks too good to drop because of my lack of understanding!
All help appreciated Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
dingjing

MVP Developer
Registered: 02/28/06 Posts: 1,634
|
|
Posted 08/23/10 at 06:53 AM
|
Reply with quote
#5
|
|
|
Imports System.Linq
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 08/23/10 at 07:15 AM
|
Reply with quote
#6
|
|
Thanks dingjing, its got over that issue but now I'm getting:
Compiler Error Message: BC30518: Overload resolution failed because no accessible 'Where' can be called with these arguments: Its refering to the same line - I'm out of my depth here! Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
dingjing

MVP Developer
Registered: 02/28/06 Posts: 1,634
|
|
Posted 08/23/10 at 08:32 AM
|
Reply with quote
#7
|
|
|
It might be lost in translation.
I am not exactly sure how to write this statement in VB: c => !(c is Literal) && c.Visible
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 08/26/10 at 08:37 AM
|
Reply with quote
#8
|
|
Being a "not so good with code conversions programmer" I naturally reached for an online conversion utility and tried several - all of which gave the same answers as yours.
I'm left with that sinking feeling that I've stumbled across another bug in ISD unless anyone else can show how to get round this error - using C# is not really an option although I might create a copy application and try it.
All help appreciated.
Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
dingjing

MVP Developer
Registered: 02/28/06 Posts: 1,634
|
|
Posted 08/26/10 at 10:10 AM
|
Reply with quote
#9
|
|
|
Please give me a few more days (update: hours). I will have an elegant solution for you.
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 08/27/10 at 01:32 AM
|
Reply with quote
#10
|
|
Thanks dingjing,
I converted the application over to C# but lost most customisation's and then got into more difficulties again as I am just not used to C# syntax.
I also use Delphi and embedded C and all have their oddities!
Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 09/27/10 at 06:33 AM
|
Reply with quote
#11
|
|
Any more ideas on this dingjing?
Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
dingjing

MVP Developer
Registered: 02/28/06 Posts: 1,634
|
|
Posted 09/27/10 at 07:33 AM
|
Reply with quote
#12
|
|
|
You don't have to convert your main project to C#. It can and should stay in your favorite language. So you don't lose your existing customizations.
You can add the extension project as C# or VB, or add as reference.
|
|
Loading...
|
|
rogerb

Registered: 06/19/09 Posts: 172
|
|
Posted 09/27/10 at 08:47 AM
|
Reply with quote
#13
|
|
I'm afraid I'm relatively new at this dingjing so I'm a little lost when you say Quote: You can add the extension project as C# or VB, or add as reference. I' still using VB so I'm not sure how this works
All help appreciated
Roger B
__________________ ~
Favourite phrases:
Like your words, one day you may have to eat them!
The 50-50-90 rule - anytime you have a 50-50 chance of getting something right theres a 90% probability you'll get it wrong!
|
|
Loading...
|
|
janthony
Registered: 05/21/09 Posts: 74
|
|
Posted 11/11/10 at 11:45 AM
|
Reply with quote
#14
|
|
Dingjing:
Thank you for this I am was able to implement your code and compile without errors.
At runtime though I get a javascript error, to me it appears to be a part of the script registration process but I am unsure. The attached image has the screen shot of the error.
The only thing I see questionable in my environment from your example is the addition of the jquery in the master page prologue. There was no section to add it to. So I may not have the reference in the correct place. I tried downlaoding and including the jquery.js file with no affect.
Any ideas?
Thanks,
Jim
|
|
Loading...
|
|