Buy My Account


Basics
Overview
Easy Code Customization
Sample Applications
Video Demos
Customers
Free Training
Pricing & Ordering
Download Now!

Product Tour
Product Tour
Web & Cloud Applications
Mobile Applications
SharePoint Applications
Charts and Reports
Security
Team Development
What's New in V11.0

Technical Materials
Training Courses
Online Help
Technical Forums
White Papers
One Day Web Apps E-book
System Requirements
Product Roadmap
Version History
Iron Speed Technical Forums
Register New Posts Chat
 
 
 


Reply
 
Author Comment
 
dingjing

Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,684
Reply with quote  #1 
Highlight a table row with one line of code

Keywords: TableControl, highlight, conditional
mhweiss

Avatar / Picture

MVP Consultant
Registered: 08/29/05
Posts: 1,850
Reply with quote  #2 
Thank you! This is great and will be very useful...
Michael

__________________
michael@occasiosystems.com
http://www.occasiosystems.com
Tooth

Registered: 10/10/06
Posts: 69
Reply with quote  #3 
Thanks from me too
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
dingjing

Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,684
Reply with quote  #5 
Imports System.Linq
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
dingjing

Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,684
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
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
dingjing

Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,684
Reply with quote  #9 
Please give me a few more days (update: hours). I will have an elegant solution for you.
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
dingjing

Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,684
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. 
rogerb

Avatar / Picture

Registered: 06/19/09
Posts: 172
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!
janthony

Registered: 05/21/09
Posts: 126
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
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer
   
 

Terms of Service Privacy Statement
Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.