|
leppie wrote:
from what i can see u dont seem to have VS.NET
Yes, I'm using Visual C# .NET. But I'm typing most code manually.
The problem is not adding the items, those are added correctly (I can see them as expected in other Views). What I'm having trouble with is adding the columns. In another form I use a list view also and everything works OK. I copied that exact same code to this panel (it's a Panel control, but the one that works is on a TabPage which is also a Panel) and same problem, no columns show up.
I'll give it a try to your way of adding items, but I don't think that will solve it.
Thanks!
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
I fixed this problem!!!
The problem was I was calling lstView.Clear() and that removes all items AND columns. I now call lstView.Items.Clear() and everything works as it should!
Thanks everyone for your help!
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi,
I need to know, if the tab-key is pressed in a single-line textbox. But if any control in the form has the TabStop-property set to true, there will no event be raised before leaving the control. The only event raised is the KeyUp event of the form, if the KeyPreview is set to true. But when it is raised, the focus is already in the next control.
Does someone know a way to check, if the tab-key is pressed? I thought I could work with the Leave-event, but I don't know, if the control will be left because of the tab-key.
Thank you for your help,
Michael
muenchen-michi@gmx.de
|
|
|
|
|
I'm not sure, but there is an AcceptTab property (and AcceptReturn too, I don't know if it only applies to multiline)... you could try setting that to true and handling KeyDown/KeyUp/KeyPress... then you call SelectNextControl to move the foucs to the next control in the tab order.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi Luis,
thanks for you answer. But these properties only apply to multiline textboxes. So this won't help me.
Michael
muenchen-michi@gmx.de
|
|
|
|
|
Why would you like to trap the tab key? to be able to prevent the user from tabbing away from your control?? what for? maybe we can find another solution.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi all
Has anyone a clue how to do or approach this?
If you dont know what I mean, open Word and select some text and click the Highlight Button
Thanking all in advance
Cheers
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I think that the only way you're going to be able to do this is if you add the code with the rich text format codes applied. You will have to get the text from the box via Rtf. This will give you the text of the box with all of the format codes applied. You can then manually edit it and put in the format codes that you want. However this is a very large pain in the ass.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Thx
But SelectedRtf (and Rtf) from a RichTextBox seems to be very picky. I was try just to copy SelectedRtf from one RichTextBox to another and 9/10 times exceptions was thrown.
I will try it though. Maybe it was escaping or something.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hello, I am trying to find out if anyone has a ComboBox Control for Visual Basic .NET that will handle Multi-Columns. Also, I have seen a Drop-Down TreeView Control as well on this site...has anyone Implemented this into .NET yet? I could really use both of these ASAP!
|
|
|
|
|
The TreeView control can be downloaded at www.asp.net. It is part of the IEWebControls package. As for the other, I haven't seen one yet...
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|
|
I am developing an eShop with ASP.NET and my IDE is Visual Studio .NET. I want to use Cookie to keep Shop Cart information at client side. I also defined a class and some functions to work with them, for example adding an item to Cookie (Shop Cart), updating items and deleting an item.
But when I use these functions, no changes apply to the cookie value.
I think it is because the class doesn't have access to change Response and Request of Page.
Please let me know how I can solve this problem.
Here is the code I developed (Unnecessary parts are not shown.)
C# Class:
public class ShopCart
{
/*
...
*/
/******************** Cookie Remove_Name ******************/
// Removes an Item from Cookie
public void Remove_Name(HttpRequest thisReq, String Cookie_Name, String sName)
{
HttpCookieCollection MyCookieColl;
HttpCookie MyCookie;
MyCookieColl = thisReq.Cookies;
MyCookie = MyCookieColl[Cookie_Name];
if (MyCookie!=null)
{
if (MyCookie.Values.Get(sName)!=null)
{
MyCookie.Values.Remove(sName);
Response.Cookies.Add(MyCookie);
}
}
}
} // class
ASP.NET Call script:
ShopCart myShopCart = new ShopCarts.ShopCart();
myShopCart.Remove_Name(Request, "eShopCart", "item_01"
Look forward to hearing from you all.
Sassan
|
|
|
|
|
Hi Guys,
I have a method that does multiple updates(hundreds of them) into SQL server.The data is in the form of array of objects . Now i'm looping through them and updating them one at a time .This is taking much time .Is there an efficient way of doing this?
Thanks in advance
sarith sutha
|
|
|
|
|
Sarith,
can you give me an example of one object in your array?
Maybe a code snippet.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
i hope this will do
for(int index = 0 ; index < TaskItems.Length ; index++)
{
piSqlStmt=new StringBuilder("INSERT INTO Tasks (Task_id,Task_Desc,Task_status) VALUES";
piSqlStmt.Append("'"+TaskItems[index].Task_id+"'");
piSqlStmt.Append(",'"+TaskItems[index].Task_Desc+"'");
piSqlStmt.Append(",'"+TaskItems[index].Task_status+"'");
piSqlCommand.CommandText = piSqlStmt.ToString();
piSqlCommand.ExecuteNonQuery();
}
sarith sutha
|
|
|
|
|
|
Thanks a lot jparsons,
I think this is much better way.
sarith sutha
|
|
|
|
|
Why are you using the for{} statement? For accessing an array of objects, you should use the foreach{} statement...
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|
|
David Stone wrote:
Why are you using the for{} statement? For accessing an array of objects, you should use the foreach{} statement...
I don't really see the benefit of this.
Unless using an index on the array object causes a lookup each time, similar to using field indexes in a recordset.
Is this the case here too?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
David Stone wrote:
Why are you using the for{} statement? For accessing an array of objects, you should use the foreach{} statement...
You can only use the foreach statement if the array (collection) does not get modified in any way. IOW If you have to alter a property during the foreach loop, you will get an exception and you have to revert to the for statement.
As far as I can see , the foreach statement is purely a shortcut for
IEnumerator en = Array.GetEnumerator();
do
{
Object obj = en.Current;
} while (en.MoveNext());
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
The idea of creating a new dataset with this data and then adding it as a whole to the database might work (as per post).
Another idea would be to package all the data into parameters (i.e. have a parameter each for: ID, Desc, Status and add all ID's to the ID parameter and all Desc's to the Desc parameter etc...) You can then split these up using T-SQL. I have some script for this if you'd like.
You're probably going to have to weigh up the performance as well as whether or not the "tasks" table can be recreated each time.
HTH
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Hi Simon,
I would Like to have the script.
Thanks in advance .
sarith sutha
|
|
|
|
|
Here's the debug version of my script.
There are a number of assumptions that I took, viz: delimiter value and length and I didn't need to do any escaping of characters in "array".
If you have issues implementing this, feel free to contact me: simon_stewart@hotmail.com
DECLARE @Array varchar(50)
DECLARE @iStart int
DECLARE @iEleFound int
DECLARE @iMaxEleLen int
DECLARE @iNextDelimIndex int
DECLARE @iEleLen int
SET @Array = '1,2,3,4,5,6,7,8,9,65,66,67,100,101,102,654321'
SET @iStart = 0
SET @iEleFound = 0
SET @iMaxEleLen = 5
SET @iNextDelimIndex=0
SET @iEleLen =0
print '---------'
print 'LENGTH of string: ' + CAST(LEN(@Array) AS VARCHAR)
while CHARINDEX ( ',' , @Array,@iStart ) > 0 -- for each element in the array
begin
SET @iEleLen =1 --default
--if not ',' or ''
if (CAST(SUBSTRING(@Array, @iStart + 1, 1) AS char(1)) <> ',') and not(len (SUBSTRING (@Array, @iStart + 1, 1)) = 0)
begin--element found at this index
SET @iNextDelimIndex = CHARINDEX ( ',' , @Array,@iStart+1)
if(@iNextDelimIndex=0)
begin
SET @iNextDelimIndex = CAST (LEN(@Array) AS VARCHAR)+1
print 'latest element is next:'
end
SET @iEleLen = @iNextDelimIndex - @iStart
--DB function would occur here
print 'NEXT DELIM LOCATION-->' + CAST(@iNextDelimIndex AS VARCHAR(10))
print 'VALUE FOUND-->' + RTRIM( CAST(SUBSTRING(@Array, @iStart + 1, @iNextDelimIndex - @iStart-1) AS char(10)) ) + '<--'
SET @iEleFound = @iEleFound + 1
end
else --no element found at this index
begin
print 'do nothing'
end
SET @iStart = @iStart + @iEleLen
end --if (CAST(SUBSTRING(@Array, @iStart + 1, 1) AS char(1)) <> ',') and not(len (SUBSTRING (@Array, @iStart + 1, 1)) = 0)
print '------ ELEMENTS FOUND: ' + CAST(@iEleFound AS CHAR(2)) + ' ---------'
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Hi There,
I'm using David Hall library and is running into a bit of problem. When creating a task, we can supply the user and password in which the task shall run. The problem I am having is that I want to schedule a task to run with all the priviledges of the current authenticated user, in other words, the person running the program should be the person executing the task when the time comes. I am trying to avoid saving the password of the user and sending it to the task scheduler. Are there anyway I can tell the system to grab my credentials and use that to run the scheduled tasks?
Thanks,
|
|
|
|
|
I've recently been playing with command line compiles of my C# projects. Beeing accustom to C and C++ I'm used to building all of my files into object code and then compiling all of hte object code together in the end. Looking around I thought that "csc /t:module" was the answer.
However i was very mistaken. Everything will compile with /t:module just fine and it willa ll apparently compile together at the end by using the /addmodule switch. However the resulting executable is still dependent upon the .netmodule files.
Is there any way to combine the .netmodule files into one assmebly so that it is no longer dependent upon all of these small little object files. My main intent here is to create incremental builds so that I'm not recompiling all of my classes at the same time. Any advice would be appreciated.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|