|
Hi,
I am developing application in which an Arraylist has a list of users. I also have a TreeView to show the users in the list.
Can anyone tell me how to bind the TreeView Control to the Arraylist?
Thanks in advance,
Murali
|
|
|
|
|
Murali,
If you want to use a tree view then one way i can suggest is that, you
you populte the tree view like below:
Suppose "tvw" is the tree view.
TreeNode ndRoot = new TreeNode(stringUserName);
tvw.Nodes.Add(ndRoot);
this way you can add all ur users in the tree view.
Manoj
Manoj
Never Gives up
|
|
|
|
|
Hi Manoj,
Thanks for your reply. I am able to add nodes into the tree view without any problem.
However, I want to bind an Arraylist to the TreeView so that the TreeView is controlled whenever the Arraylist is modified (Addition/Deletion of Users).
Is that possible?
Thanks in advance,
Murali
|
|
|
|
|
TreeView control does not support databinding.
What you can do, is have an event handler on the ArrayList, and every time you add, or remove an element from the array, you can repopulate the treeview control.
Hope that helps.
|
|
|
|
|
When I press the ‘PageUp’ key and my TreeView has focus I don’t want the selection to be on the top node. How can I override this common behavour?
_____________________________
...and justice for all
APe
|
|
|
|
|
private void YourTreeView_KeyDown(object sender, KeyEventArgs e)
{
if(!(e.KeyCode.ToString()=="PageUp"))
{...}
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello Muammar,
Your answer works, but I think it's more save (Fat finger sundrom: "PoagUip" or something like that) to use they System.Windows.Forms.Keys enumeration for the comparison.
Proplem with the string comparison is, that it compiles fine, but it's not working like expected!
if(e.KeyCode == Keys.PageUp)
Just for info!
All the best,
Martin
|
|
|
|
|
Hello,
Muammars answer works, but I think it's more save (Fat finger sundrom: "PoagUip" or something like that) to use they System.Windows.Forms.Keys enumeration for the comparison.
Proplem with the string comparison is, that it compiles fine, but it's not working like expected!
if(e.KeyCode == Keys.PageUp)
All the best,
Martin
|
|
|
|
|
Hi,
I've created a new cursor that i want to use in my code and added it to the Resources file. How can i create a new Cursor object but without specifying the full path, since the Cursor constructors wants the path of the .cur file.
Anyone got any ideas?
Regards,
Gareth.
|
|
|
|
|
hi
try this
Cursor cursor = new Cursor(this.GetType(), "mycursor.cur");
regards
|
|
|
|
|
Hello,
i want to do perticular action when user press control + enter key combination.
now ican only find only control or enter key press.
How to check the control + enter key combination.
Thanks in advance.
Rahul Kulkarni
|
|
|
|
|
Hello,
If you Handle the KeyDown for example.
You can do this:
(e.Control && (e.KeyCode == Keys.Enter))
All the best,
Martin
|
|
|
|
|
|
try
{
HTMLInputElement ieButton = (HTMLInputElement)myDoc.all.item(ButtonName, 0);
ieButton.click();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
i m doing internet explorer automation.
i do the automation of click event of buttons ,i need same for images ,can any one help me out?
|
|
|
|
|
Take the image as a HTMLElement object and use the InvokeMember method, providing the name of the function as a parameter.
I don't know for sure if it'll work, but it's worth a try.
Good luck!
|
|
|
|
|
can u plz provide me with the chunk of code for images??
|
|
|
|
|
|
The main method of a Windows Application:
static void Main(string[] args)<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
<br />
try<br />
{ <br />
Application.Run(new MainForm()); <br />
}<br />
catch (Exception ex)<br />
{ <br />
MessageBox.Show("Caught exception in Main method.")<br />
}<br />
}
I've put the Run method inside a try-catch block.
When an exception is caught inside a method that belongs to the MainForm class, I throw that exception, expecting to see the MessageBox called from the Main method.
Things happen as expected when I run the program in debug mode form VS.
However, if I run the exe file directly from the Debug folder of my project, the program behaves differently, in the sense that the message box does not pop up anymore, and instead the much-hated "Unhandled exception has occured in your application." window shows.
The same happens if I generate a beep on the PC speaker(System.Console.Beep()) instead of showing the message box.
I really don't understand. Why is the exception caught only in Debug mode??
Thanks.
|
|
|
|
|
Did you check Wikipedia?
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
MicealG wrote: Did you check Wikipedia?
Dude don't take things personally
I think his intension was only for fun/kidding perpose
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi!
Although I don't understand why this behaviour is like it is in every detail, I think I can tell you how to get consistent behaviour in every case:
Add
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); before calling Application.Run(... and the corresponding event handler like this:
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
throw e.Exception;
}
Now every exception will be caught by your "top level" try/catch.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks. It does the trick, even though it's a little unorthodox.
PS: I like you signature.
|
|
|
|
|
hi all
while using reports...
in a table sum of one column will appear when there are values in the columns
when there are no values in the column #Error appears...
i wanna remove that #error and display some thing else
i am using aggregate function SUM in the footer...
thanks bye
|
|
|
|
|
Hey folks,
If someone could shed some light on this error message it would be great.
Error Message
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
No unhandled exception??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|