|
No, it's read only!
You can stack a couple of ComboBoxs on top of eachother if you want, set the Visible properties to False and just set the one you need to show at that time to True.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That I can do. Thanks for the idea,
sb
|
|
|
|
|
I have an application that has a treeview setup. Depending on the node selected on the treeview a datagrid is loaded with appropriate data from SQL.
At this point the treeview shows with the node highlighted and the datagrid is displayed with the data.
I want to have the cursor positioned in row 0 column 1. I tried the following logic:
DataGrid.CurrentCell = New DataGridCell(1, 0)<br />
DataGrid.Focus()
I'm having no success finding the correct syntax.
Any suggestions?
Lost in the vast sea of .NET
<a href="http://www.komputing.com/Pricelist.html">Visit my website at www.komputing.com</a>
|
|
|
|
|
Don't the Row and Columns numbers start with 1, not 0?
The Index's into the Row collections start with 0.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When I have two records in the datagrid and use the code:
DataGrid.CurrentCell = New DataGridCell(1, 1)
the cursor doesn't blink anywhere till I click on the datagrid. At that point it blinks in the second row and second column.
If I use (0,0) and click on the header of the datagrid the cursor blinks in the first row, first column.
I don't want to have to click on the datagrid to start data entry. I want the end-user to click on the treeview node and then start data entry in the first row, first column without having to use the mouse to click in the appropriate cell or to click on the header of the datagrid.
Any other suggestions?
Lost in the vast sea of .NET
<a href="http://www.komputing.com/Pricelist.html">Visit my website at www.komputing.com</a>
|
|
|
|
|
OK. 0,0 it is. I've never had to change the CurrentCell myself...
Try setting the Focus to the DataGrid FIRST, then make the change to the CurrentCell.
DataGrid.Focus()
DataGrid.CurrentCell = New DataGridCell(0,0)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I had the logic like this:
DataGrid.CurrentCell = New DataGridCell(0,0)<br />
DataGrid.Focus()
I changed it to your suggestion of:
DataGrid.Focus()<br />
DataGrid.CurrentCell = New DataGridCell(0,0)
Neither way allows the cursor to be focused in the cell. If I set it to (1,1), the pointer on the side has the arrow pointing at the second record, so the CurrentCell logic is working but the Focus() is not.
I've also set the breakpoint on that line just to make sure I'm not going crazy and the logic wasn't being executed. It is.
Thanks for your suggestions...
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: I've also set the breakpoint on that line just to make sure I'm not going crazy and the logic wasn't being executed. It is.
Set the breakpoint on what line? Did it execute these two lines or not? What you said contradicts itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The logic is executing. I set the breakpoint right above this section of code and stepped through the code.
Any other suggestions?
Lost in the vast sea of .NET
-- modified at 14:51 Friday 27th January, 2006
|
|
|
|
|
Here is the code I've used which works.
DataGrid.CurrentCell = New DataGridCell(0, 0)
SendKeys.Send("{TAB}")
SendKeys.Send("{TAB}")
SendKeys.Send("{TAB}")
SendKeys.Send("{HOME}")
This just doesn't seem like the best way to get focus on a datagrid.
Does anyone have a better suggestion?
Lost in the vast sea of .NET
|
|
|
|
|
I'm having a massive amount of trouble registering a VB.net created COM/ActiveX dll on another machine. Every time I try to register with regsvr32 it says "<myfile>.dll was loaded, but the DllRegisterServer entry point was not found. This file can not be registered"
I have created the dll using the "Register for COM interop" option enabled and the dll works fine on my machine.
The test machine I'm using has the .net framework installed but just won't register the dll.
Am I doing something stupid? Any help would be greatly appreciated.
|
|
|
|
|
It's not as easy as you might think. You might want to read Exposing .NET Framework Components to COM[^] on MSDN.
RegSvr32 only works with REAL COM servers, not .NET assemblies impersonating them. The registration utility you're looking for is RegAsm.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply Dave. Am reading your link now.
Have tried the regasm.exe and it seems to work fine but I now get a message "File or assembly name mydll, or one of its dependencies, was not found" when I try to use my class.
Any Ideas or is it very much more complicated than I am thinking?
Thanks again
|
|
|
|
|
Does your assembly reference any other controls or libraries that might not be installed on the target machine? What did you set References to (Hint, Hint!) when you wrote this thing?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I don;t think there should be anything missing from the target machine.
I'll explain what i've done.
Someone here has developed a huge model in XL and is frightened about giving it away to people as they can see all of his precious code. I was asked to bung it into a dll as xl security is supposedly quite poor.
He's used loads of arrays in the xl model so I just ripped out a couple of functions into vb.net and passed these array's byref. Turned the interop option on and built the solution. It worked fine on my machine. The code only uses variables and numbers!
If you can help me sort this I'll be over the moon as its starting to do my head in a bit!
Thanx 4 all the help already.
|
|
|
|
|
Again, did your project add any REFERENCES (check in the References folder of your project!). Such as to the Office PIA's?? If your project makes any references to anything other than the standard ones for the project you built, you have to make sure that the libraries those references are pointing to are also installed on the target machine.
If you added a Reference to the Office PIA's, that version of Office, or greater, better be installed on the target machine.
I can't make it any clearer than that. You're project is referencing something that is not installed on that machine.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi again Dave,
Thanks for all your help.
Still can't get it to work though. I have no references at all in the references folder in solution explorer and the only things the solution imports in the AssemblyInfo are:
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
It imports Microsoft.VisualBasic in the project property pages. The target machine has exactly the same version of office as I have on the machine that works.
I have run out of all options now.
Thanks again for all your help
|
|
|
|
|
I have no idea. There's something your code is referencing that just isn't there or is mis-registered.
Stupid thing maybe, but the same version of the .NET Framework installed? Same version of MDAC maybe?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 20:45 Thursday 26th January, 2006
|
|
|
|
|
im trying to compare the username and the password for login from the database.
after compling this error come out:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 44: Function DBConnection(ByVal strnomatriks As String, ByVal strnoic As String) As Boolean
Line 45:
Line 46: Dim MyConn As SqlClient.SqlConnection = New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("psm").ConnectionString)
Line 47:
Line 48: Dim MyCmd As New SqlClient.SqlCommand("sp_ValidateUser", MyConn)
could anyone help?
|
|
|
|
|
The problem is that one of these methods returned Nothing . All of your code is assuming that everything worked. There is no error checking built into any of this.
Check to see if ConfigurationManager.ConnectionStrings("psm") actually returned anything. You're trying to call the .ConnectionString property on something that, apparently, doesn't have an instance!
Did .ConnectionString actually return anything, or did IT return Nothing .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i still cant get it?
i want it to get a certain data in the database to campare with the user given data?
|
|
|
|
|
Step through the code line-by-line. It's the only way your going to see what's going on. Look in the Local Variables box in the debugger after each line executes so you can see the values of variables.
I can't tell you what's wrong because I can't see enough of the code. You'll learn a HELL of alot more if you step through and watch the code yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello world!,
I want to make my classes, is possible that I can imported this classes?.
I think that I can use:
Imports MyClass
Is possible, How can do that?...
gangeles
|
|
|
|
|
In the project that you want to use your class library in, you have to add a reference to the library.
If the class library project is in the same solution as the project you want to use it in, add a project reference. If your library is completely finished and won't be changing, you can add a reference to the .DLL that your class library is in.
Only after the reference is added, will your Imports statement work and your code be able to use those classes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 11:12 Thursday 26th January, 2006
|
|
|
|
|
I got an error message as "IIS dose not Support ASP.Net version 1.1 you can not run the application " while running the WebApplication on VB.Net
I have done all the things like
1> Configuring the IIS
2> Reinstalling on .Net
The Error Still remain
Can anybody tell me the solution.
sagarharale@gmail.com
Sagar Harale
|
|
|
|