|
I have 2 button (1) Select All (2)DeSelect All button. Select All button should select all the checkboxes in the GridView...Importantly when the paging is allowed...
The problem is, when paging is allowed, the checkbox is checked only in the first page not on the second page and the subsequent ones. The following code shows the code.
How can I get every check boxes selected? how to do with Javascript? If possible, can we do without Javascript.. with C#.
Please help.
protected void Select_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox chk = row.FindControl("chkSelect") as CheckBox;
if (chk.Checked == false)
{
chk.Checked = true;
}
}
}
Sanjeev
|
|
|
|
|
hey..did u get the ans for ur prob?? i m stucked wit d same prob n not findin any solution for it..i wud be happy if u cud share d code ...
thanks
|
|
|
|
|
I am developing a chat/message server application. I am trying to create a fast and efficient way to keep track of which clients are communicating with each other. My solution for this is to assign a unique "chat session id" to a group of 2 or more people that are communicating with each other. And each person that are within a chat session have their own unique Id for that session. So each unique session has its own table of users with their socket information and other stuff. So what I have done is create a hashtable with the session ID as the key and the user datatables as the objects in the hashtable.
First question: Do you think this is an efficient way to do things?
Second question: Will using in memory datatables and hashtable give me better speed performance than using an actuall database(sql or mysql)?
Third question or would it more efficient to have a datatable that contians hashtables of user ids?
modified on Monday, June 9, 2008 2:42 PM
|
|
|
|
|
hi...
im working on a project and im getting in trouble here with the undo function...
so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance
P.S
if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that?
andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?
modified on Monday, June 9, 2008 1:59 PM
|
|
|
|
|
Wow - you don't want a lot, do you? There are many ways you can do the "Undo" functionality, but the easiest is probably this[^] implementation.
|
|
|
|
|
To support undo/redo operations, you'll want to read up on the "Command" design pattern. Google "Command Design Pattern" and you'll get a myriad of explanations.
|
|
|
|
|
MrAdar wrote: the user does an action in a picturebox...
At this point, your design is broken. IF there are actions, you probably should not use a picturebox.
MrAdar wrote: how do i cause a second form to show it self lets say..on a push of a button while another form is already running
You really need to buy a book.
You want a modeless form, which means you call Show instead of ShowDialog.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I have a TreeView control on my .aspx page. When I load the page, for any selected last child node, I want to show its entire path (to the parent first root node) in RED color.
Please can anyone tell me how I can achieve this?
Thank you.
|
|
|
|
|
I am writing a backup program and the user would like to enter the name or IP address of a machine and then my program would grab all the shares (I only care about the folders) from that machine and backup those folders. Does anyone know how to do this. I have tried using the ManagementClass but cannot figure it out yet.
|
|
|
|
|
Will this[^] article help?
/ravi
|
|
|
|
|
Thank you for the reply. I can get the shares on the local machine by using code (
|
|
|
|
|
Thanks for your reply. I can get the shares on my local machine but cannot get the shares another machine. The user who will be running this application has network admin privileges.
|
|
|
|
|
hi friends and excuse for this long post,
i got some idea from greeeg about making a picture white and black. the method was:
public static bool GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
byte red, green, blue;
for(int y=0;y<b.height;++y)>
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
p[0] = p[1] = p[2] = (byte)(.299 * red + .587 * green + .114 * blue);
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
</b.height;++y)>
it takes a picture as the argument and processes it to make it white and black.
then, again greeeg helped me and gave a method to make picture become white and black in a defined timings (like the smooth conversion of colored screen to grayscale when you click 'Turn Off' in strat menu in windows xp):
const float transitionTime = 5000f;
float normalizedTransitionTime = millsecondsSinceTransitionStart / transitionTime;
red = (byte)Lerp(normalizedTransitionTime , coloredPixelR, bwPixelR);
green = (byte)Lerp(normalizedTransitionTime , coloredPixelG, bwPixelG);
blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB);
and said that the Lerp method is actually works like this:
float Lerp(float amount, float value1, float value2)
{
return value1 + (value2 - value1) * amount;
}
for conversion of a picture from colored state to gray scale in a time like 500 milliseconds i merged the above ideas (of greeeg).
so i changed the first 'GrayScale(Bitmap b)' method to this:
public static bool GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3
byte red, green, blue;
for(int y=0;y<b.height;++y)>
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
p[0] = (byte)Form1.Lerp(1f, (float)p[0], (float)(.114 * blue));
p[1] = (byte)Form1.Lerp(1f, (float)p[1], (float)(.587 * green));
p[2] = (byte)Form1.Lerp(1f, (float)p[2], (float)(.299 * red));
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
</b.height;++y)>
i have just changed the poinings of second 'for'
for example 'p[0]' is as blue in 'blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB)'
and the result was unsuccessful
have i done a correct work till now? (ofcourse not )
i think the problem is in choosing the second and third arguments of 'Lerp (normalizedTransitionTime , coloredPixelR, bwPixelR)'.
finally, my questions are:
1- what should the arguments be then?
2- can i change Red, Green and Blue colors of picture (to make it gray scale) in an other way (without using the pointers in 'GrayScale(Bitmap b)')?
|
|
|
|
|
Sajjad Izadi wrote: can i change Red, Green and Blue colors of picture (to make it gray scale) in an other way (without using the pointers
Yes, but it would be much slower. This is the fastest way to do it. Sounds like someone else has done all the work for you so far. I'm not sure what you're asking exactly, 'the result was unsuccessful' doesn't tell us much.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i don't know how to use these two methods to make a smooth conversion of colored picture to a gray scale one in a ditinct time.
yes, i myself never could guess to use such pointers to do my work. i'm learning from the friends.
|
|
|
|
|
Well, not sure why I would help you if I get a 1 vote for my trouble, but, the fact is, for bigger images, you probably can't. You'd need to create the individual frames first, THEN roll through them, for it to be smooth.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you mean to make the frames as an *.jpg in a folder and start to play them in my form like an animation. so the new and i think main question is "how is making a half grayed picture to produce the frames"?
i mean a picture which is not completely colord nor completely gray.
modified on Monday, June 9, 2008 2:04 PM
|
|
|
|
|
Actually, an easier way to do all this. Create your grey image. Then draw it on top of the color one over and over with varying transparency, which you get by setting the opacity of the ImageAttributes class.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am trying to programmatically change the IIS settings for a folder. I have been following the following article, which shows how to use the DirectoryEntry class to manage active directory settings: http://www.codeproject.com/KB/system/everythingInAD.aspx#10
This code has been working to change the settings for the root directory of my folder, the IISROOT/MyAPP folder. My problem is that I need to change IIS settings for the IISROOT/MyAPP/Child folder, but have not been able to get a handle to the child folder using the DirectoryEntry. Is there a way that I can get a DirectoryEntry variable for this child folder, so that I can change the appropriate settings?
|
|
|
|
|
I figured it out. Before setting the path for the MyAPP directory, I created the child directory as an "IIsWebDirectory". When I properly set the path for the parent, the child directory was appropriately filled with files.
|
|
|
|
|
I want to genericize a class so that it can be used in any application. This class loads application settings. The problem is that in order to load the application's settings, I have to use the application's namespace (?) to do it, like so:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
somevar = MyApp.Settings.Default...
}
}
}
How do I change it to something like this:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
myapp = SomeMagicHappensHere();
somevar = myapp.Settings.Default.blah blah blah
}
}
}
When I hover over MyApp in the constructor show in the first example, it shows the type as "namespace", but I apparently can't cast to that type (or I'm doing it wrong).
Can anyone help?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John,
Right, MyApp is the namespace, just like System is the namespace for System.String. Namespaces aren't types by themselves, so you can't do things to them like you would to classes.
Would something like this work?
public AppSettings(ApplicationSettingsBase settings)
{
} ApplicationSettingsBase is the base class for all project settings. You would construct your AppSettings class like this:
AppSettings settings = new AppSettings(MyApp.Settings.Default); Is that what you're looking for?
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Trees/Forest/Blind - many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In C:\abc\PiPe Modules\pipe\PiPe\source: "C:\Program Files\CVSNT\cvs.exe" -q update -P -d
ObjectFlatten.cs
CVSROOT=:pserver:vgcoder2@192.168.2.137:2401/piperoot
C ObjectFlatten.cs
Error, CVS operation failed
Tortoise Tip: One or more of your files has a conflict. This means that someone else has altered the
same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve
the conflict.
Unable to understand what the problem could be
|
|
|
|
|
humayunlalzad wrote: Unable to understand what the problem could be
I'm guessing that it might be:
humayunlalzad wrote: One or more of your files has a conflict. This means that someone else has altered the same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve the conflict.
|
|
|
|