|
Hi,
I have a dgv that is created programmatically and bind it to a datatable. The Columns/Cells are all text.
I insert an int (as a string) into a cell when I need to and use that int to lookup another datatable when I need to. Works well
What I would like to do is dislay an image if the cell contains an int rather than the int itself.
I know I can make the columns concerned image cells and I presume I would then need to record the image name in the datatable rather than the int which is what I want. I thought of using the cell.tag to hold the int but I need that field for another purpose. I'm not even certain that is what I want because I need to store the int, not the image name.
Is there someway of using the cellformating event to convert that cell into an image cell and show an image? I think it should be possible but can't find the right code.
TIA,
Glen Harvy
|
|
|
|
|
May use on item data bound event and create a new image cell and by downcasting paste it to the cell u want
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
Any chance of you speaking in C#?
I would really appreciate a code snippet.
Thanks.
Glen Harvy
|
|
|
|
|
There is a string like code#project now i want the string code into one variable and project into another variable how is it possible.
Thanks,
yamini.
|
|
|
|
|
Split the string using SPLIT()
Ex.
string a = "code#project"
string [] b = str.split('#')
Regards
KP
|
|
|
|
|
|
use the split function, with '#' as the delimiter
Keshav Kamat
India
|
|
|
|
|
|
I want to have a text file in which one can do copy and paste to only those users to whom i would have given the permission.So i want to disable copy and paste button to restrict from other users. How could I do this in c#
|
|
|
|
|
you could write your own code, get the user information and do stuff accordingly
http://www.csharphelp.com/archives2/archive439.html
or use azman
http://community.bartdesmet.net/blogs/bart/archive/2006/06/29/4112.aspx
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
I have a problem with a windows service i have created. I am using SqlDependency to notify my service of changes in a table in a database. When I compile this in Debug mode everything works fine. However when I compile in Release mode I am getting problems. The service runs fine until the table in the database changes and then the service just hangs. Does anyone have any ideas on why this might be occuring in the release build but not the debug build?
|
|
|
|
|
I've figured out this problem is a result of timing. I have put in some simple for loops just to create delays and the problem has gone away.
Now to implement a better solution.....
|
|
|
|
|
It seems that the download dialog triggered by this code
prevents the label control “Label2” to show its message.
What should I change/add to this code in order that the message
"Download Complete" could appear in the web page in the
“Label2” control ?
Here is the relevant code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
protected void DownlFile_Click(object sender, EventArgs e)
{
string web_path = "./items/X-103.pdf";
string path = Server.MapPath(web_path);
FileStream MyFileStream = new FileStream(path, FileMode.Open);
long FileSize;
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);
MyFileStream.Close();
Response.ContentType = "application/pdf";
Response.AddHeader
("content-disposition", "attachment; filename= X-103.pdf");
Response.BinaryWrite(Buffer);
Label2.Text = "Download Complete";
}
<asp:Button ID="DownlFile" runat="server" Text="Download The File"
OnClick="DownlFile_Click" />
<br /> <br />
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
|
|
|
|
|
You can't do that. Either set the type to a file download ( in which case it will pop up an open/save dialog, or otherwise, you're writing a PDF to your page, in which case, you're showing a PDF, which will replace any HTML, and you shouldn't be generating any. I do a response.End after code like this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hello people!
I'm using the function SHGetFileInfo from shell32.dll to get the icon handle for a normal file, but i don't know how to get the ghosted icon for a hidden file.
Anyone knows if there's a way to get the ghosted icon?
Thanks in advance
|
|
|
|
|
Is SFGAO_GHOSTED what you're looking for?
|
|
|
|
|
Well, I use IShellFolder::GetAttributesOf to find out if a file is hidden. The problem is that I don't know if there's an ghosted icon in the system imagelist, or if I have to make the ghosted effect for the icon myself.
|
|
|
|
|
This link might be of some use, the article has vb code but you can download or view online both C#/VB.
|
|
|
|
|
Hi,
Can be an easy one for you.
When I tried to insert a big picture into a small picture box, only a small part of the picture was shown in the box. How can I display the whole picture into the picturebox without changing the box size.
|
|
|
|
|
|
Thank you for the reply. That helped me.
|
|
|
|
|
Hi
I would like to know how I can estimate the total physical memory usage (as well as availability) for the entire system, so I can display the usage figures in my application. Is there a class in the .NET framework I can use? If not, is anybody aware of any libraries I can download that contain such a class?
Furthermore, I would like to be able to invoke the GC and collect garbage from all processes running on the system. Again, I would appreciate it if someone could point me to a class that provides these facilities. I have tried using the GC class, but I can only collect garbage for my own application.
Thanks in advance .
Ray
|
|
|
|
|
You can use WMI to obtain the amount of physical RAM by adding a reference to the System.Management namespace.
You would query the Win32_PhysicalMemory provider.
A quick search on CodeProject showed this article: http://www.codeproject.com/cs/system/GetHardwareInformation.asp
I'm sure that forcing GC on all processes is impossible as not all applications are managed.
I however look forward to reading any other comments.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hi,
I am working on a Windows based project in Visual Studio.net.
1) I would like to store some documents (like Word, Excel, PPT) in SQL server 2000 and
2) Then show its shortcut as shown in a desktop in a listview.
3) When we click on that shortcut the file should open.
Can somebody please help me with the above 3 scenarios.
-- modified at 1:43 Monday 2nd April, 2007
|
|
|
|