473,774 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't determine correct type at runtime

I am trying to determine the type for ActiveControls using 3rd party
controls (Infragistics in this case) during runtime and getting a rather odd
return type at runtime for the UltraWinEditor.

Code shippet is as follows:

if ( ActiveControl.G etType() == typeof(UltraTex tEditor))
{
UltraTextEditor tb = (UltraTextEdito r) this.ActiveCont rol;
if (tb.Multiline == true)
return true;
}

I am expecting to see an UltraTextEditor for the ActiveControlTy pe but,
instead, getting "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions", so
the "if" statement fails on the control.

If I modify the "if" statement to: "if (ActiveControl. GetType().ToStr ing()
== "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions")", the subsequent
cast fails.

Does anyone know what would cause the control type to be different at
runtime than what it was built from?

(BTW, the test form is ONLY using UltraTextEditor controls, so the type
should be the same for each.)
Jun 27 '08 #1
4 2702
Bill Fuller wrote:
I am trying to determine the type for ActiveControls using 3rd party
controls (Infragistics in this case) during runtime and getting a rather odd
return type at runtime for the UltraWinEditor.

Code shippet is as follows:

if ( ActiveControl.G etType() == typeof(UltraTex tEditor))
{
UltraTextEditor tb = (UltraTextEdito r) this.ActiveCont rol;
if (tb.Multiline == true)
return true;
}

I am expecting to see an UltraTextEditor for the ActiveControlTy pe but,
instead, getting "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions", so
the "if" statement fails on the control.

If I modify the "if" statement to: "if (ActiveControl. GetType().ToStr ing()
== "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions")", the subsequent
cast fails.

Does anyone know what would cause the control type to be different at
runtime than what it was built from?

(BTW, the test form is ONLY using UltraTextEditor controls, so the type
should be the same for each.)

I'm going on assumptions here, but judging by the full name of that
control, I'd say you have focus to the editor, but it is actually
similar to a user control and what you're reading there is an embedded
editor inside what dropped on the form.

DevExpresses uses the same approach, with something like a
RepositoryTextE dit, which is then used internally in both grids and
normal droppable edit controls. I don't know if the DevExpress controls
would give me the same behavior as you're seeing though.

In any case, it's just a guess. I guess the best way to get a concrete
answer would be to ask the Infragistics guys about this.

Let me pose another question... What specifically are you trying to
accomplish with the code? Perhaps there's a different way to do what you
want to do than the one you're currently trying.

--
Lasse Vågsæther Karlsen
mailto:la***@vk arlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #2
On Sun, 20 Apr 2008 09:50:57 -0700, "Bill Fuller" <so*****@nospam .com>
wrote:
>I am trying to determine the type for ActiveControls using 3rd party
controls (Infragistics in this case) during runtime and getting a rather odd
return type at runtime for the UltraWinEditor.

Code shippet is as follows:

if ( ActiveControl.G etType() == typeof(UltraTex tEditor))
{
UltraTextEditor tb = (UltraTextEdito r) this.ActiveCont rol;
if (tb.Multiline == true)
return true;
}

I am expecting to see an UltraTextEditor for the ActiveControlTy pe but,
instead, getting "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions", so
the "if" statement fails on the control.

If I modify the "if" statement to: "if (ActiveControl. GetType().ToStr ing()
== "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions")", the subsequent
cast fails.

Does anyone know what would cause the control type to be different at
runtime than what it was built from?

(BTW, the test form is ONLY using UltraTextEditor controls, so the type
should be the same for each.)
Hmm, could it be that UltraTextEditor is a composite control,
containing an Infragistics.Wi n.EmbeddableTex tBoxWithUIPermi ssions at
runtime?

As the latter seems to be derived from TextBox according to:

http://help.infragistics.com/Help/Ne...hierarchy.html

what you could do instead of your if block above is this (untested):

TextBox tb = ActiveControl as TextBox;
if(tb != null) {
if(tb.Multiline ) {
return true;
}
}

Regards,
Gilles.

Jun 27 '08 #3
"Lasse Vågsæther Karlsen" <la***@vkarlsen .nowrote in message
news:Oa******** ******@TK2MSFTN GP06.phx.gbl...
Bill Fuller wrote:
>I am trying to determine the type for ActiveControls using 3rd party
controls (Infragistics in this case) during runtime and getting a rather
odd return type at runtime for the UltraWinEditor.

Code shippet is as follows:

if ( ActiveControl.G etType() == typeof(UltraTex tEditor))
{
UltraTextEditor tb = (UltraTextEdito r) this.ActiveCont rol;
if (tb.Multiline == true)
return true;
}

I am expecting to see an UltraTextEditor for the ActiveControlTy pe but,
instead, getting "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions",
so the "if" statement fails on the control.

If I modify the "if" statement to: "if
(ActiveControl .GetType().ToSt ring() ==
"Infragistics. Win.EmbeddableT extBoxWithUIPer missions")", the subsequent
cast fails.

Does anyone know what would cause the control type to be different at
runtime than what it was built from?

(BTW, the test form is ONLY using UltraTextEditor controls, so the type
should be the same for each.)


I'm going on assumptions here, but judging by the full name of that
control, I'd say you have focus to the editor, but it is actually similar
to a user control and what you're reading there is an embedded editor
inside what dropped on the form.

DevExpresses uses the same approach, with something like a
RepositoryTextE dit, which is then used internally in both grids and normal
droppable edit controls. I don't know if the DevExpress controls would
give me the same behavior as you're seeing though.

In any case, it's just a guess. I guess the best way to get a concrete
answer would be to ask the Infragistics guys about this.

Let me pose another question... What specifically are you trying to
accomplish with the code? Perhaps there's a different way to do what you
want to do than the one you're currently trying.

--
Lasse Vågsæther Karlsen
mailto:la***@vk arlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
It sounds like you are pointing me in the right direction as to the source
of my problem. I did post the question to Infragistics, but need to find an
answer ASAP, if possible, and I have found them to be rather slow in
responding.

What I am trying to do (and it is working for the most part) is set a global
hook via IMessageFilter to convert the ENTER key to a TAB key for the entire
application, which is largely data entry type forms. However, I have also
set a virtual method for this that can be overridden in instances where the
Enter key on a particular form needs to be processed rather than use the
default, such as in the case where a multiline textbox that allows Enter key
handling may be on the form... or perhaps a button key. This code would
process the override if I can get it to work... was taken by surprise with
the type return as a standard Microsoft textbox works as expected.
Jun 27 '08 #4
"Gilles Kohl [MVP]" <no_email_avail able@wrote in message
news:0l******** *************** *********@4ax.c om...
On Sun, 20 Apr 2008 09:50:57 -0700, "Bill Fuller" <so*****@nospam .com>
wrote:
>>I am trying to determine the type for ActiveControls using 3rd party
controls (Infragistics in this case) during runtime and getting a rather
odd
return type at runtime for the UltraWinEditor.

Code shippet is as follows:

if ( ActiveControl.G etType() == typeof(UltraTex tEditor))
{
UltraTextEditor tb = (UltraTextEdito r) this.ActiveCont rol;
if (tb.Multiline == true)
return true;
}

I am expecting to see an UltraTextEditor for the ActiveControlTy pe but,
instead, getting "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions", so
the "if" statement fails on the control.

If I modify the "if" statement to: "if (ActiveControl. GetType().ToStr ing()
== "Infragistics.W in.EmbeddableTe xtBoxWithUIPerm issions")", the subsequent
cast fails.

Does anyone know what would cause the control type to be different at
runtime than what it was built from?

(BTW, the test form is ONLY using UltraTextEditor controls, so the type
should be the same for each.)

Hmm, could it be that UltraTextEditor is a composite control,
containing an Infragistics.Wi n.EmbeddableTex tBoxWithUIPermi ssions at
runtime?

As the latter seems to be derived from TextBox according to:

http://help.infragistics.com/Help/Ne...hierarchy.html

what you could do instead of your if block above is this (untested):

TextBox tb = ActiveControl as TextBox;
if(tb != null) {
if(tb.Multiline ) {
return true;
}
}

Regards,
Gilles.
Your untested code fix did the trick...thanks.
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
2236
by: dkcpub | last post by:
I'm very new to Python, but I couldn't find anything in the docs or faq about this. And I fished around in the IDLE menus but didn't see anything. Is there a tool that can determine all the exceptions that can be raised in a Python function, or in any of the functions it calls, etc.? /Dan
0
1552
by: Ken Durden | last post by:
I'm getting the following exception coming out of a block of unmanaged C++ code. Thread executed for 1.03 sec and died with the following exception: External component has thrown an exception. ==== Primary Call Stack ==== at ?Setup@EdgeTopImageProcessor@Edge@InspectionAlgorithm@August@@$$FQAEXHHHHW4eBayerFormatType@BayerImage@234@ABUEdgeTopParam@1234@PAVErrorTraveler@Unmanaged@Infrastructure@4@@Z(EdgeTopImageProcessor* , Int32 , Int32...
3
319
by: TS | last post by:
Is there a way to convert a variable from 1 type to another type that you determine at runtime? I'm trying to pull a value from a ListDictionary's key. The datatype of that key must be identical to pull that value. I have a property to pull this value based on the key supplied, but I am using an object type on my parameter. I want to do a ctype() on the lookUpListKey and change it to the correct data type so that it's corresponding value...
2
1235
by: William Morgan | last post by:
Public Declare Sub ydec_set_callback Lib "yDecLib.dll" (ByVal CallbackFunc As Long) Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal lpvDest As String, ByVal lpvSource As String, ByVal cbCopy As Long) Private Function yDecEventHandler(ByVal MsgType As Long, ByVal Data As Long, ByVal Msg As Long, ByVal MsgSize As Long) As Long ' this function handles all events fired by the decoder library ' for most events,...
4
4346
by: neil brown | last post by:
Whenever I try and run a project in VB.NET 2003, all i get is: "An unhandled exception of type 'System.ArgumentException' occurred in Unknown Module. Additional information: The parameter is incorrect." or "An unhandled exception of type
2
1674
by: TimJR | last post by:
I am looking for a way to determine in RunTime if a given object is Xml Serializable (short of trying to serialize it to xml and catching the exception). Is this possible? Since an object must have a Default Constructor to be XmlSerializable I have tried something like: Type valueType = aRandomObject.GetType();
6
4901
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
3
2238
by: Giampaolo Rodola' | last post by:
Hi there, since the socket.socket.family attribute has been introduced only in Python 2.5 and I need to have my application to be backward compatible with Python 2.3 and 2.4 I'd like to know how could I determine the family of a socket.socket instance which may be AF_INET or AF_INET6. Is there some kind of getsockopt() directive I could use? For now I've been able to determine the family by using: # self.socket = a connected...
4
4067
by: Salad | last post by:
I have a situation where some, not all, users get the message "Couldn't find file "F:\AccessApps\AppName.mdw". This file is required for startup". My app the users are attempting to access is written A2003 and they use the A2003 runtime to access the application. They use a desktop icon that specifies the location of Access, the Appname, and the MDW file to use. Ex: "C:\ProgramFiles\Office\MSACCESS.EXE" "C:\Apps\App.MDB" /wrkgrp...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.