|
I found some code on the net to allow drag and drop on a grid.
Code can be found at :- http://www.danielsoper.com/programming/DataGridViewDragDropRowsColumns.aspx[^]
Has any one had any experience of using this object? AS I am getting some frustraiting results!
Once I have added my DataSource and DataMember the control will not let me change the names of any of the columns. If I rename Column1 to Name, when I close the properties page it renames its self Column1
I can get round this by renameing the columns in code datagridView2.Columns[0].HeaderText = "Name";
When I run my form the control seems to append a number of blank columns to the begining of my data,
if my data returns 23 columns the grid displays 43 columns
Any help would be appreciated.
|
|
|
|
|
Graham_4 wrote: AS I am getting some frustraiting results!
You apparently did not understand that the page is showing one way to do this. It is not a reusable class. One minute of looking at the code easily finds the following:
protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
{
e.Column.SortMode = DataGridViewColumnSortMode.Programmatic;
<span style="color: Red; font-weight: bold;"> e.Column.HeaderText = "column " + e.Column.Index;</span>
base.OnColumnAdded(e);
}
This clearly indicates that the code is for example purposes, not reuse. I am afraid your plan to copy/paste software development has been upset due to you not having a clue what you are doing. Shocking, no really it is.
led mike
|
|
|
|
|
i want to select that row in true db grid on which mouse right click button is clicked but now i left click button clicked on true db grid it will select that row but with the right click it doesnot select the row.
i want to select the row of grid with both right and left click buttons of mouse
thanks & Regards
Tanvir.
dasda
|
|
|
|
|
Best bet is to try the vendor's website - or fire the left click event when the right button is clicked?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Anyone know if there's code out there for generating a paginated interface like Word, with a drawing area the size of the page selected in the printer settings?
|
|
|
|
|
I don't know if it will help in your context but I think there is a print preview control available in .NET for Windows Forms.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
In VB.net when we define DaySel as:
Dim DaySel As Date then when we use the command totaldays = DaySel.DaysInMonth(DaySel.Year, DaySel.Month)
it will response the corresponding days of the selected month (28 or 29 or 30 or 31 days)
However when I define in VC#
System.DateTime DaySel = default(System.DateTime);
- I only can get DaySel.DayOfWeek or DaySel.DayOfYear
Anyone can show me how to get the total days of the selected month?
Thank for nay help
|
|
|
|
|
//
// Summary:
// Returns the number of days in the specified month and year.
//
// Parameters:
// year:
// The year.
//
// month:
// The month (a number ranging from 1 to 12).
//
int daysInMonthCnt = System.DateTime.DaysInMonth(int year, int month);
|
|
|
|
|
The DaysInMonth is a static method, so you use the class name to call it, not a variable instance:
DateTime.DaysInMonth(DaySel.Year, DaySel.Month)
I don't know the exact reason why you can call static methods using a variable instance in VB, but it's not very logical.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I need to be able to execute a SQL request thru a thread and wait till the end of the execution of the query to get the error code of the query.
What is the best way to do so ?
I am using the System.Data.SqlClient and System.Threading libs
Thanks in advance
Regards
Pierre
|
|
|
|
|
Check out the BackgroundWorker component
|
|
|
|
|
hi
i have some qus.s i hope u answer me please
1- am working on C sharp 2003 i want when i click on a command in form1 it opens new form and this new form it contain text box >>>
what the code i wrote i command ?????????
2- what it mean by UCOMIStream???? and should i used it n C# too or just in v.b
Thanx
|
|
|
|
|
Miss_hacker wrote: what it mean by UCOMIStream
I have been using C# for 6 odd years, and never needed to even find out what that is used for. I suspect something to do with COM. Well, COM is dead!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Miss_hacker wrote: 1- am working on C sharp 2003 i want when i click on a command in form1 it opens new form and this new form it contain text box >>>
what the code i wrote i command ?????????
For starters, have a look at the documentation how to Show a window (or control) Control.Show Method [^]. There's a simple example in doc.
Miss_hacker wrote: 2- what it mean by UCOMIStream???? and should i used it n C# too or just in v.b
UCOMIStream is needed when communicating with COM objects, if you need the communication in streams between managed code and COM-object you'll neeed the interface regardless of the language, but you would be better off not using COM objects unless it's a requirement.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
You d´ont want to do that.
1) use mdi child/parent forms or
2) use usercontrol as pages, for that you will have to use delegates.
About second question i d´ont know nothing about that.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Not a technical question, rather a fairly nebulous question about a UI design.
In summary, I have an application that may or may not perform a task every minute. I need to create a visual representation of when this task will be performed over a day/week. Something like a time line where a user can view a single day/week that displays when the task will execute.
As an example, the task is configured to execute at 12,34,45,50,56 past the hour in the hours 1,4,8,15,18,20,21,22
The problem is that there are 2440 minutes in a day, so creating a visual UI is somewhat complicated. Unless of course the user has a 500 inch wide screen monitor
Just incase anybody has heard of it, I am trying to create this for Crontab jobs.
|
|
|
|
|
Why don't you 'steal' MS Outlook's calendar view... I think it's a neat way to present events over time.
|
|
|
|
|
MrEyes wrote: The problem is that there are 2440 minutes in a day
Wow, you are either cursed or lucky with an extra 1000 minutes a day
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
leppie wrote:
Wow, you are either cursed or lucky with an extra 1000 minutes a day
I don't know. There have been days when I've felt like there's an extra 1000 minutes in there.
|
|
|
|
|
Vogon Guard Well, the hours are good.
Ford They'd have to be.
Vogon guard But now you mention it, I suppose most of the actual minutes are pretty lousy.
|
|
|
|
|
Cursed with fat fingers and the lack of a typing wand
|
|
|
|
|
There are several third party calendar controls available (free and licensed). I would pick up a nice looking and use that.
Some of those have even Gantt-like view just in case that you want to visualize the length and other information for the tasks some point in future.
I wouldn't believe that it has any effect on visualization if the task scheduling system is crontab. Only when getting the data into the calendar (or similar), you must implement your own 'parser' for crontab syntax (how to separate minutes, hours, days, what * means etc).
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hii
Can anyone tell me what's the exact difference between validating and validated events. What I know is validated occurs after successful execution of validating. But what's the need of 2 events I cant understand. plz help
if possible give code for illustration
thanx
|
|
|
|
|
One is an event you hook into when your object is validating, and the other is the event you hook into when your object has finished validation. You hook into the validating event if you want to perform some work when the validation is started off.
|
|
|
|
|
hello everyone..
please help me about this.
I have an application that requires cv loader... For example, I have a resume (in any format, txt or doc file), then when I upload it using c# or in any language and i need to get the name, address and contact number of the person that will be saved in an oracle database...
Is there someone who can give me some hint in creating this functionality
thanks in advance.
jyn
|
|
|
|