|
|
Im using Visual studio.net 2003 language C#
i want to insert a readonly dataRow in my Datatable(which is bound to the grid)how do i do that?
thanks
regards paula
|
|
|
|
|
Use the following:
<br />
yourTable.DefaultView.AllowNew = False<br />
|
|
|
|
|
Hello,
I am trying to hide a certain column in a DataGrid, but to no avail. Here is the part of the code:
<br />
this.dataview.Table.Columns["VersionID"].ColumnMapping = MappingType.Hidden;<br />
this.dataGridCashFlow.DataSource = this.dataview;<br />
Any ideas, why it would not work? Column VersionID still shows up in the DataGrid
Thank you
|
|
|
|
|
Add a DataGridTableStyle object to your DataGrid and include only the columns you want visible in it's GridColumnStyles collection.
|
|
|
|
|
use tablestyle and set the column width = 0
***********example of some of the code************
tsGrid.MappingName = "data";
// Add it to the datagrid's TableStyles collection
dgClientView.TableStyles.Add(tsGrid);
// Hide the first column (index 0)
dgClientView.TableStyles[0].GridColumnStyles[0].Width = 0;
Don't know if this is what your looking for?
marcelw
|
|
|
|
|
Yeah, I did that and it was wroking. (setting the width to 0). I just wanted to know how come the Mapping command did not work.
Thank you very much for the input guys.
|
|
|
|
|
Hi
I want to create a Form in a constructor (or the load event) like this:
public class Form1
{
private Form fm;
public Form1()
{
fm = new Form();
fm.Show();
}
}
It is important for me to use Show() and not ShowDialog(). The problem is, that the Form is created and displayed, but it does not react on any mouseclick (or move...). When I use the same code from within a Button callback everything works fine. As far as I could figure out by now, there is no Messageloop created in the CTOR or in the Load callback.
So what options do I have?
Thanks in advance
remarks:
The Form1 was created in an extra Thread. This seems to cause the problem. But I need this Thread.
Snow.
-- modified at 9:00 Tuesday 25th October, 2005
|
|
|
|
|
Logically, the problem is that Form1 hasn't been created yet nor is it isn't ready to be a "realized window" and yet you've created another window and tried to realize that. There is simply a mistiming of events in your logic (child window is created and displayed before the parent is created and displayed). I'm not surprised that fm never "appears".
I would seperate these Forms or at the very least move the Show of the child form out of the contructor. You can still "parent" the one form off the other even if they are complete seperated objects. If you still want to agrigate the child form, show it on the Load event. That is my best guess without writing or compiling test code.
|
|
|
|
|
Your only option is to run a message pump on that thread also, using the Application.Run[^] method.
public Form1()
{
fm = new Form();
Application.Run(fm);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I need to know where to check for system status? like messenger 'Away' after say 5 minutes. I need to run code when it goes into such a status, and again when it returns to normal.
marcelw
|
|
|
|
|
I tried to create static classes but failed. I tried something like,
public static class StaticClass
{
public static int start()
{
return 5;
}
}
but it didn't work. I am using .NET framework 1.1. Can anyone help me!
Bikash Rai
|
|
|
|
|
That isn't supported until .NET 2.0
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
In 1.1, static is not an object level modifier. Just define all of your functions as static instead and you'll get the effect you desire.
|
|
|
|
|
And of course, declare the constructor protected or private to prevent the class from being instantiated by clients.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Bikash,
In the 1.1 .NET framework, a static class is a sealed class with a private constructor. I use them all the time.
Your example would look like this:
public sealed class StaticClass {
private const int start = 5;
private StaticClass() {
}
public static int Start {
get { return start; }
}
}
Brian Leach
-- modified at 16:04 Tuesday 25th October, 2005
|
|
|
|
|
I want to know how i can implement push server tech. in client\server application
|
|
|
|
|
I need help on how I can insert data from a csv file into a ms sequal
DB table. Any ideas
|
|
|
|
|
You could look at the BULK INSERT[^] command.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
How can i get the value of the scrollbar in my Richtextbox???.
I have seen an example with api functions!!
But in the .NET Framework 2.0.2 there must be this property!!
Yours sincerely,
Berni
|
|
|
|
|
I am using mock objects in .net 2.0, but it seems like nmock fails completely under 2.0.
Creation of the mocks works fine, but as soon as i try to call a method on my mock instance i get a FatalExecutionEngineError.
Nmocks site seems to be down atm, and googling havent been helpfull.
Have anyone experienced a similar problem, or can point me to a mock framework that works in .net 2.0?
Best regards,
Thomas Skovsende
|
|
|
|
|
Hi there,
I'm looking for some good articles on how to upload files using C#, and saving them into a specific directory, this I will probably set in my code.
And lastly, I am looking for articles on how to resize images after it is uploaded. I just need to resize the width and height, that's all, and maybe save the file from .png, or .gif, to .jpg.
I would appreciate it if someone could get back to me on this.
Regards,
ma se
|
|
|
|
|
|
I've written a nice little office add in, but now I need to make it auto updating. I've gone through every piece of sample code and googled like crazy, but I still have the same exact problem I had this morning.
The application updater block pulls the App.config file for the exe that starts a process. For an add in for Excel it's looking for an Excel.exe.Config. Of course it can't find it. You can also pass the updater you "ApplicationID", which is supposed to help in some way I'm sure, but doesn't. Either I'm handing in the wrong applicationID, or in some cases it seems to ignore it.
I've started creating overrides for methods in the Updater Application Block Project, but everytime I think I've got what I need there is another call further along that is calling back to Excel.Exe.Config.
Has anyone created an autoupdating Office Add In, or an auto updating dll. At this point I'm probably at the point where I'll be chucking the UAB and writing this thing myself.
Any help would be greatly appreciated.
Thanks,
Jeremy
|
|
|
|
|
Hi,
I just have a couple of questions:
If I have the following, what is the value of decEuro if the textbox txtEuro is empty? decimal decEuro = Convert.ToDecimal(txtEuro.Text.Trim());
Is decimal the best data type used for a currency value?
/********************************************************/
Check the following function:
public static Object CheckDecimalForDB(decimal decCheckDecimal)
{
if(decCheckDecimal != 0)
return decCheckDecimal;
else
return DBNull.Value;
}
The datatype/type returned when decCheckDecimal contains a value, is decimal, or Object?
/********************************************************/
I need to format data in a data grid, firstly time based on Culture info (South Africa), and secondly, decimal values to contain only 2 decimal places after the comma.
This is how I populate my datagrid with the 2 values:
<asp:Label id="lblDateRequested" Text='<%# DataBinder.Eval(Container.DataItem, "DateRequested", "{0 }") %>' runat="server" />
<asp:Label id="lblAgencyID" Text='<%# DataBinder.Eval(Container.DataItem, "Euro") %>' runat="server" />
"DateRequested" has a datetime datatype in SQL Server, and "Euro" is of type money.
/********************************************************/
I need to post data from one form to another form. I used Server.Transfer but then the new page doesn't display in the url "bar". Basically I just want the data to go from page A to page B. Usually in classic ASP I used Request.Form("txtFName") to get the value of the textbox in page A. I'm not sure if the Response.Redirect method does this, don't think so.
This is all for now, I hope to here from the experts soon.
Regards.
ma se
|
|
|
|