|
It can be done, but it's a beast to do. Learn to do custom cells for the DataGridView. Once you know how that's done, you need to have a custom HTML data grid view cell. To do that, you need to be able to render HTML to a cell: you can do this using the mshtml control and its IHTMLElementRenderer interface, which has a DrawToDC method that you can use to render HTML to some graphics surface. See here [^]for more info.
|
|
|
|
|
i have to validate values on client side...
after all the validations i need the entered the value by the user...
that has to be carried to cs file
i can validate using javascript and html tags..
how can i get input which i have evaluted with html controls and javascript to cs file...
asp.net controls doesnot support java script
|
|
|
|
|
kalyan_2416 wrote: asp.net controls doesnot support java script
That's not really true. ASP.NET controls ARE HTML and javascript.
The easiest way to pass values back to the server is to put a HiddenField control on your page, write some javascript which passes the control's Id to a variable, then you can grab the control and put values in there, they will then be available on the server side on postback.
I'm still not sure what you mean tho, how is validation significant here ?
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 )
|
|
|
|
|
Hi,
I need to detect a particular USB device connected to the computer. To do this I use the SetupAPI to enum all usb devices and retrieve the vendor ID. However, I know that the device is a Mass Storage device so I need to retrieve the device path from the DISKDRIVE/USBSTOR class to be openned with CreateFile for SCSI Pass Through. How can I relate a raw usb device to its usbstor class.
It happens that if I open Device Manager and view the properties under the
Universal Serial Bus controllers->USB Mass Storage Device
for the device in question, under Details, Bus Relations, this string correspond to the device in question under
Disk drives->Properties->Details->Device Instance ID.
|
|
|
|
|
I'm working on a serializer and I've run into an issue with private field access. When I emit and run the IL code to access the private field of a class, it results in a FieldAccessException. I've gone looking for information on this but found very little. One of the suggestions was that the class I emit, that has the code that accesses the private fields must be have a special permissions attribute.
So I added the following to my type builder for the class:
Type[] ctorParams = new Type[] { typeof(SecurityAction) };<br />
<br />
ConstructorInfo ci = typeof(ReflectionPermissionAttribute).GetConstructor(ctorParams);<br />
PropertyInfo pi = typeof(ReflectionPermissionAttribute).GetProperty("Unrestricted");<br />
<br />
CustomAttributeBuilder cab = new CustomAttributeBuilder(ci, new object[] { SecurityAction.Assert }, new PropertyInfo[] { pi }, new object[] { true });<br />
<br />
typeBuilder.SetCustomAttribute(cab);
However, this still results in the same FieldAccessException. Does anyone have any experience with private field access via the ILGenerator, and could shed some light on this for me, I would be very happy.
I've also tried:
typeBuilder.AddDeclarativeSecurity(SecurityAction.Demand, new PermissionSet(PermissionState.Unrestricted));
With the same result.
|
|
|
|
|
Hi to all!
What is the worlds biggest .NET open source project?
is it NASAs World Wind project?
Regards,
cyberjoe
|
|
|
|
|
I don't think Guiness Book of World Records keeps track of developer specific projects. Would this be better suited in one of the more general forums, considering this is not a C# question that needs assitance?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Here are two different code approaches I have used, but neither works.
int i = thisForm.GetChildIndex(textBox);
thisForm.Controls[index].Text = "Something";
thisForm.Controls[index].Invalidate();
and
Control controlTest = thisForm.textBox;
controlTest.Text = "Something";
controlTest.Invalidate();
The reason I'm trying to do this is that I would like to be able to "map" controls to fields in a database (I'd like to do it myself rather than do data-binding), so I need a way to be able to create a list (or other collection) of controls and the data field to put in that control. It is rather like UpdateData in VC++. But I can't seem to update the screen with code like what I've shown above.
How do I go about this? I hope the question makes sense because I'm sure one of you guys knows how to do it if I can just figure the right way to ask the question.
Thanks.
|
|
|
|
|
I wonder if you need to cast it to be a textbox first ?
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 )
|
|
|
|
|
Thanks for the suggestion, but it turns out the problem was something totally different.
The textbox in question is part of a CustomControl, and when I declared the public Attribute for Text I accidentally used the "new" keyword instead of "override". So, when I set .Text for the control, it was not actually setting the .Text for the TextBox part of the CustomControl like it was supposed to.
Turns out the code snippet I put in my original message DOES work just fine.
Thanks anyway for the response.
|
|
|
|
|
I want to create a program to relay stuff trough full screen applications,
Like multi media keyboard volume displays.
But i have no idea where to start could anyone point me in the right direction please.
|
|
|
|
|
Every C# application i make takes an excessive amount of RAM, like, the program I'm working on right now is about 500kb in size, but it takes almost 20MB ram.
I release every resource i use by flushing\closing\disposing\making it null and then calling the garbage collector but the app still takes like 17mb RAM...how can i make my program use less memory?
and another question: how can i use an exterior icon in my application, as in not compiling the program with it, but making the program use an exterior ICO file (thereby making it smaller)?.
|
|
|
|
|
It doesn't matter whether or not you load/unload resources. You could have a program that wrote Console.WriteLine and then Console.ReadLine and do nothing else, and the memory will still be taken up - the reason is because you still need to load the Runtime into memory.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If you're judging by the "Memory" column in task manager, that isn't the amount of memory your app is using. To prove it to yourself, minimize your application and see how much "memory" your app is using. (Hint: the "memory" tab is how much Windows has allotted to your process, not how much your process is actually using)
p.s. you don't need to null references; the garbage collector will free them when there are no more references to the object, regardless of whether it's null.
|
|
|
|
|
Ok, and what about the icon question? do you happen to know how to do that?
|
|
|
|
|
Bitmap bitmap = new Bitmap("foo.ico");
IntPtr iconHandle = bitmap.GetHIcon();
Icon icon = Icon.FromHandle(iconHandle);
myForm.Icon = icon;
|
|
|
|
|
I assumed he meant the icon for the program itself, that is, the one you see in Windows. I don't get it tho, what's his program going to do if the file is not there ? I just don't see any benefit.
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 )
|
|
|
|
|
First of all, it's not linear, any app will use the framework, writing simple apps doesn't give you an idea of how much RAM a complex app will use. I have written a couple of apps over several years that have major functionality in them, and their footprint is < 70 MB.
sharpiesharpie wrote: how can i make my program use less memory?
Write it in C++.
Remember, RAM is cheap nowadays.
sharpiesharpie wrote: (thereby making it smaller)?.
I don't think you can, and why would you want to ? Realistically, your exe would be, what, 10k smaller ?
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 )
|
|
|
|
|
Not really, the icon is 158Kb...so without the icon, the program would be only about 300kb big instead of 500k...and anyway I'd like to know how to do it.
so...any help?
|
|
|
|
|
Make a smaller icon.
The thing is, your program can't ship without that icon. Nor can it ship without a 20 MB runtime. So, what's the point ?
Your code does not run to show your icon in Windows, Windows does that. So, there may be a way to set it up, but it has nothing to do with C#.
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 )
|
|
|
|
|
sharpiesharpie wrote: the icon is 158Kb
Then it's not an icon, or you've got a HUGE number of icons in one file. Even at 32-bits deep, a 32x32 icon would be less than 5Kb!!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
sharpiesharpie wrote: Every C# application i make takes an excessive amount of RAM
You can't just rely on the "Mem Usage" column in Task Manager to determine this. Every .NET application is handed a bit of a managed memory allocation that is controlled by the .NET runtime (CLR) itself. The Mem Usage column in task manager doesn't know anything about this memory so you're not seeing accurate and reliable results. As other people have pointed out, there are far better ways to determine the actual amount of memory your application is using.
sharpiesharpie wrote: I release every resource i use by flushing\closing\disposing\making it null and then calling the garbage collector but the app still takes like 17mb RAM...how can i make my program use less memory?
All of this is fine, except for explicitly calling the garbage collector. You really don't want to do that unless you have a very good reason to. The biggest impact you will actually see from doing that is that your applications performance will suffer. Each time the garbage colletor runs, it effectively freezes the main thread of your application so it can determine what objects are still being referenced. You actually hurt performance by making too many GC calls, so it is generally best to let the GC decide on it's own when it should run.
sharpiesharpie wrote: how can i use an exterior icon in my application, as in not compiling the program with it, but making the program use an exterior ICO file (thereby making it smaller)?.
Not sure what the point for doing this actually is. A typical icon file is small, so embedding it as the main application icon (the normal way of doing things) shouldn't cause an issue.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi
Hope someone to show me how to make my coding work.
I had a procedure to generate the data into dataset. By using for loop, I can use responsewrite to show the data from dataset. When I bind the dataset on gridview. It shows the following error.
The event 'System.Web.UI.WebControls.BaseDataBoundControl.DataBound' can only appear on the left hand side of += or -=
There is my code:
DataSet ds = new DataSet();
ProjectOne.AuctionItems product = new ProjectOne.AuctionItems();
ds = product.ListAllProducts();
GridView1.DataSource = ds;
GridView1.DataBound();
Thanks.
Thanks.
|
|
|
|
|
DataBound is an event (as the error indicates) and no method, so you cannot call it. You probably wanted to write GridView1.DataBind(); .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
<br />
public partial class Form1 : Form<br />
{<br />
WebClient wc = new WebClient();<br />
public Form1()<br />
{<br />
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressCallback);<br />
InitializeComponent();<br />
}<br />
void DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)<br />
{<br />
pb.Value=e.ProgressPercentage;<br />
<br />
}<br />
private void load_url(string url)<br />
{<br />
<br />
wc.DownloadData(url);<br />
<br />
}<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
load_url(tblink.Text);<br />
}<br />
<br />
}<br />
Hi,
The problem with the above code is that the following method is never called..
void DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)<br />
{<br />
pb.Value=e.ProgressPercentage;<br />
<br />
}<br />
so the progressBar(pb) never get updated...Any Ideas what I am doing wrong?
I am using .Net Framework v 2.0
Regards
Q@!$3r
|
|
|
|