Yes there is a solution , I had the same problem as you, you can use the same tool that Visual Studio ships to Install your app, to include the .net framework, there is a trick, you have to take a look to:
To disallow users from clicking or selected a particular column, you will have to use custom table style for your data grid. In this custom table style you will have to add custom data column styles - DataGridTextBoxColumn.
Derive a class from DataGridTextBoxColumn and in that override the Edit method and in that method do nothing.
public class MyTextBoxColumn : DataGridTextBoxColumn
// TODO: Add constructor logic here
protected override void Edit(...)
base.Edit(..); // call base class
//don't call baseclass, so no editing....
I tried what you said but it's not working the way I implemented it. I'll explain what I did.
//Create a custom Column Style for the 1st Col: Questions
CurrencyManager cm = (CurrencyManager)this.BindingContext[dtTable];
PropertyDescriptor pd = cm.GetItemProperties();//Get Prop for the 1st col
MyControls.MyDataGridTextBoxColumn myColStyle = new MyControls.MyDataGridTextBoxColumn(pd);
I put a label on top of that column in the data grid & now u cannot edit the text in that column. But if u click on any editable control like combo box in the datagrid, or even at any place in the grid where there are no rows, the first row gets selected ... What's happening !?!
I was able to remove that extra row with AllowNew property set to false.
Thanks for all ur help. But I think we need a much stronger DatagRid than what we have right now !
Add custom column styles to the custom table style AND then add the custom table style to the datagrid's table style collection. If you do the reverse, the way you have done, the data grid will not use your column styles
In my project, i'm using a third party ActiveX component.
Right clicking the component during runtime will display a popup menu.
My problem is that i want to disable it ( or disable some of the options in the menu). Is it possible ?
This gives me a ComboBox with these values :
So far so good, the thing is this combo is also used to display properities that somebody has previously selected and may want to edit - if the form is displaying previously selected values I use the following code to select the users previous selection
cmbImportance.SelectedItem = user_prefs.importance;
Which all seems relatively simple, but lets assume that the previously selected importance is "Normal" what happens is that I end up with a combo box with the following values :
Obviously the 'NormalCritical' select object is wrong, but I cant work out why it is doing this - I have tried used SelectedText as well and it did the same thing.
I've written a quick and dirty image object that accepts parameters along the url to generate either a resized image or captions.
It takes parameters something like this:
The problem, which is a ticklish one, is that it seems to strip out the acute and graves from the end image, leaving nothing in it's place.
In the codebehind I've specified:
myGraphics.DrawString(Caption, CaptionFontFamily, new SolidBrush(CaptionColour), CaptionXRegister, CaptionYRegister, new StringFormat(StringFormatFlags.NoFontFallback)); to ensure that the characters won't be substituted with anything else. This has not resolved the problem. Been looking for a couple of hours for the answer to no avail. I've also tried setting the culture in the web.config file by the way...
Any ideas would be much appreciated
As I thought that C# uses UTF8 by default, this is indeed confusing me....
HTTP uses a special encoding for some chars, e.g., accented chars. When the browser is sending the GET request for the image, it's probably messing up with the char.
See the MSDN documentation for HttpServerUtility.UrlEncode or HttpUtility.UrlEncode methods.
You can do it on anything you choose - from .bat to .net - A customer
I need to create a "package" including some pictures, sounds, and ini file.
My first idea is top compress all of themp into a zip file, change the extension to .app.
I would need to do it programatically in C#, and be able to access a given file in the zip. For instance, read only the ini to get some general information, and list the contents of the package, and then open the package when asked.