|
the event is Gridstaff_SelectedCellsChange(object sender, SelectedCellsEventArgs e)
does the 'e' not have a reference to the cell that has been changed? Now you check the complete grid! Why check teh complete grid if you are only interested in the changed cell?
'Please advice with example code. ' --> what have YOU tried?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Am using infragisticts Ultrawebgrid.
so e has only one useful option "SelectedCells".
That did not help me to Loop only for a Column
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
When a user uploads an image in my image mangement module writen in asp.net and csharp , i need to resize , write some text on top of it and save
This is working fine for all sizes of images but for large images i had to increase the font size used in code
The below code is working for small images(around 500x600)
g.DrawString("test", new System.Drawing.Font("verdana", 14, System.Drawing.FontStyle.Bold),System.Drawing.Brushes.Black, ((thumbNailImg.Width / 2)-5), (thumbNailImg.Height - 20));
But for large images
g.DrawString("test", new System.Drawing.Font("verdana", 35, System.Drawing.FontStyle.Bold),System.Drawing.Brushes.Black, ((thumbNailImg.Width / 2)-5), (thumbNailImg.Height - 20));
i need to change the font size to a larger value, otherwise it wont be readable in the image
Here is what i am doing
1) Resizing image uploaded to 250x200
2) Adding some text over re-sized image
3) Saving it
images sized around 500x600 text is readble but large images i need to change font size
I want to make font size fixed and write text on top of that with text in the image readable any idea how to do this
complete code listing is shown below
String UploadedFile = MyFile.PostedFile.FileName;
int ExtractPos = UploadedFile.LastIndexOf("\\") + 1;
//to retrieve only Filename from the complete path
String UploadedFileName = UploadedFile.Substring(ExtractPos,UploadedFile.Length - ExtractPos);
// Display information about posted file. Div is invisible by default
FileName.InnerHtml =UploadedFileName;
MyContentType.InnerHtml = MyFile.PostedFile.ContentType;
ContentLength.InnerHtml = MyFile.PostedFile.ContentLength.ToString();
FileDetails.Visible = true; //div is made visible
// Save uploaded file to server at the in the Pics folder
MyFile.PostedFile.SaveAs(Request.PhysicalApplicationPath + "images\\" + UploadedFileName );
//thumbnail creation starts
//Read in the image filename whose thumbnail has to be created
String imageUrl = UploadedFileName;
//Read in the width and height
int imageHeight = 200;
int imageWidth = 250;
//You may even specify a standard thumbnail size
//int imageWidth = 70;
//int imageHeight = 70;
if (imageUrl.IndexOf("/") >= 0 || imageUrl.IndexOf("\\") >= 0)
{
//We found a / or \
Response.End();
}
//the uploaded image will be stored in the Pics folder.
//to get resize the image, the original image has to be accessed from the
//Pics folder
imageUrl = "images/" + imageUrl;
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(imageUrl));
System.Drawing.Image.GetThumbnailImageAbort dummyCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
double aspectRatio = Convert.ToDouble(imageWidth) / Convert.ToDouble(imageHeight);
//int maxWidth = 250;
//int maxHeight = 250;
//if (aspectRatio <= 1 && imageWidth > maxWidth)
//{
// imageWidth = maxWidth;
// imageHeight = Convert.ToInt32(Math.Round(imageWidth / aspectRatio));
//}
//else if (aspectRatio > 1 && imageHeight > maxHeight)
//{
// imageHeight = maxHeight;
// imageWidth = Convert.ToInt32(Math.Round(imageHeight * aspectRatio));
//}
System.Drawing.Image thumbNailImg = fullSizeImg.GetThumbnailImage(imageWidth, imageHeight, dummyCallBack, IntPtr.Zero);
//We need to create a unique filename for each generated image
DateTime MyDate = DateTime.Now;
String MyString = MyDate.ToString("ddMMyyhhmmss") + ".png";
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(thumbNailImg);
g.DrawString("test", new System.Drawing.Font("verdana", 14, System.Drawing.FontStyle.Bold),System.Drawing.Brushes.Black, ((thumbNailImg.Width / 2)-5), (thumbNailImg.Height - 20));
//Save the thumbnail in Png format. You may change it to a diff format with the ImageFormat property
thumbNailImg.Save(Request.PhysicalApplicationPath + "images\\" + MyString, ImageFormat.Png);
thumbNailImg.Dispose();
g.Dispose();
fullSizeImg.Dispose();
//Display the original & the newly generated thumbnail
Image1.AlternateText = "Original image";
Image1.ImageUrl = "~\\images\\" + UploadedFileName;
Image2.AlternateText = "Thumbnail";
Image2.ImageUrl = "~\\images\\" + MyString;
Thanks in advance
Aneesh Kumar
|
|
|
|
|
Hi all i have a problem opening a page in a new browser windows when i click on a button in a Grid view Control. The page opens every thing fine but the it reloads my previous page where the button is. Is there a way to stop this from happening? All your Help Would Really BE appreciated.
Thanks In advance!
|
|
|
|
|
This is happening because of the postback that the button is creating. Just add "return false;" to your window.open() code. It will solve your problem.
Regards
Saanj
There is no foolish question, there is no final answer...
|
|
|
|
|
|
Anupbala wrote: The stored procedure exists in the database but still i'm getting this error
How do you get from your application to the database? Are you connecting to the correct database? Are you connecting with the correct credentials? Is the stored procedure in a different schema to the one you are using?
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Check your connectionstring with database,maybe your dataabse connectionstring in your project is different from database which exists that stored procedure.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Anupbala wrote: But i am getting error message "Could not find stored procedure".The stored procedure exists in the database but still i'm getting this error.Can any one help me out.
The problem is with your connection string, validate your connection string and check its refers to the proper database or not.
Thanks
|
|
|
|
|
Anupbala wrote and subsequently deleted: If you can't answer properly to the queries then please stay away from the forum
I'm curious about what was wrong with my response. I was merely attempting to illicit more information from you in order to attempt to help you with your very vague issue. If you don't want my help, then ignore my message. Do not send me narky messages and do not, I suspect, vote my answer as a "Bad Answer".
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
|
What were the issues you had with these? I try to be helpful where I can. I try to maintain a sense of humour and keep the atmosphere light. If you have any issues then let me know. Don't send messages, delete them, and vote me down without at least some sort of explanation - That is the utmost in rudeness. It would be like spitting on me as you walked past in the street.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Avoid deleting a message after it has gathered replies. It does leave the forum face cluttered.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Hi guys i am binding my news in to repeater control...,
i am displying the short news in that control..,
in my mouse over of the news i liek to show the brief news of that particular news
is it possible using ajax...,
in need similarly like this:
Plz mouse over on this topics "Top Business feeds from across the web"
http://www.in.com/news/business-news.html[^]
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
how to Build Multilingual Web Sites with ASP.NET
|
|
|
|
|
|
|
When I move a directory the session gets expiered. Can anybody help me out in find what is going wrong in the process of moving the directory. My session mode is 'InProc' and expiry timeout is '90' minutes. And it takes maximum 5 seconds to move the directory.
Thanks in advance.
Arindam
|
|
|
|
|
Why are you moving a directory ? That sounds pretty insane to do on a website.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hello Graus,
thanks for your early reply.Actually it is required in our project. But after moving the directory successfully session is expired. Could you please assist us to fix this issue please.
Thanks
Arindam
|
|
|
|
|
Arindam(Kunal) wrote: Actually it is required in our project.
Why is it required? What is the overall purpose, not the micro-goal.
Arindam(Kunal) wrote: Could you please assist us to fix this issue please.
What is the overall task that this directory move fits in to. Understanding the bigger picture will probably result in a better solution all round.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Hello Colin,
thanks for your reply. Actually I need to rename the directory folder by keeping all the content of that folder as it was.
Thanks,
Arindam
|
|
|
|
|
That does not answer my question. What is the overall goal of what you are trying to do.
Renaming a folder does not bring significant benefits to anyone in and of itself.
What is the content? why does it need to be kept the same? why does the name have to change? What prompts the need to rename the folder? Why is that important?
I'm looking for the big picture. I may not be able to help with this precise issue, but I may be able to help provide a different strategy for achieving the overall goal.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Arindam(Kunal) wrote: When I move a directory the session gets expiered.
Arindam,
Are you moving directory with in the current ASP.NET application ? if yes then its obvious, because it will recompile the application and will recycle the worker process, causes session expiry.
So please check it.
Thank you !!
|
|
|
|
|
Hello Abhijit,
thanks for your reply. But is there any way we can handle the session expired issue?
Thanks
Arindam
|
|
|
|