Answer Questions
thisiswhere datagridview columns databindings
Hi all. I've this table in database: columnDay, columnTotal Now, in the columnDay, are stored data like: columnDay columnTotal Mon 01 01:00:00 Tue 02 01:00:00 Wed 03 01:00:00 Thu 04 01:00:00 Fre 05 01:00:00 Sat 06 01:00:00 Sun 07 01:00:00 The number of days are directly retrieved from the month. Now, i need to design a datagridview, that have the name and number of days as columns: For ex.: int myColumn = Thread.CurrentThread.CurrentCulture.Calendar.GetDaysInMonth(myYear, datetimepicker1.Value.Month); datagridView1.ColumnCount = myColumn; for(int i = 0; i < datagridView1.Column.Count; i++) { DateTime dt = new DateTime(year, datetimepicker1.Val ...Show All
sanjeeva.s swap two rows
In Windows forms 2.0 How do I swap two rows in datagridviews and also how do i allow user to see only first 10 records or last 10 records E.g, you want swap row2 and row4, you may 1. remove row2 and row4 and store them in temporary variables 2. Insert row4 to second row 3. Insert row2 to the fouth My question is how to Interchange two rows to move a row, use DataGridView . Rows .RemoveAt and DataGridView . Rows .Insert If it's bounded to a datasource then you will have to manipulate the datasource object. If not, then use RemoveAt and Insert methods of the datagrid. ...Show All
Madhusudhan Getting a handle to a control on a form
Hi I'm new to the C# development area. I've got different forms with different controls on it, the forms are either mdi parent or child forms. What i would like to know is the following. 1)How do i get a handle to a control on a form. The control was added earlier in another class, now in this class how do i get a handle/control of it. 2)To do step 1 do you need to inherit from the class that created the handle on the form 3) Sample would be great. Thanks in advance :) Thanks a lot Hi Rizwan Excellent, this works great. This is a great example showing how you can do it with multiple forms. I will find this very handy to use. You have solved my problem already. What i would like to know in ...Show All
meetsenthilbtech Converting Text to UPPER case in a datagridview control
Hi, I've tried everything but don't seem to be able to get this to work. The seniario is this. A user inputs some text in a cell of a datagridview control and I want the text to be converted into upper case before it is stored in the database. This data is a KEY field to a table. I've tried the format method of the defaultcellstyle and the onvalidate row, and cell events but can't seem to be able to figure this out. Has anyone ever needed to do this before And, would you mind tell me how to do it Thanks, Dave Hi again, May I please ask you one more question. Here is the code: Private Sub dgMenuRoles_CellEndEdit( ByVal sender As Object , _ ByVal e As System.Windows. ...Show All
user11 ClickOnce: Problem with COM object and Manifest
I'm setting up my first project with ClickOnce. Everything was installing fine until I added a COM dll in the package. I clicked on the COM object in the references, set Isolated=True, and it made it into the publish folder. When it is installed, I received the Manifest parse error below about the enumeration constant failing for the apartment value in the threading model. According to MSDN this should be a valid value. Anyone know why this failed < comClass clsid = " {80a5017f-7f86-4559-8908-ce846f759726} " threadingModel = " apartment " tlbid = " {82825976-6d2a-4ab2-9ac8-526ea76f3699} " progid = " xxx.xxx.1 " description = " xxx Class " /> ERROR SUMMARY Below ...Show All
Clem Lau default font in RichTextBox
Hi, I want to set the default font for an empty RichTextBox. I have found no property for that. Simply settings the Font property does not seem to work. I also tried modifying the Rtf accordingly. This works at first, but the font settings get discarded when the user selects the whole content of the RichTextBox and then deletes it. So how can I set the default font Thanks Sebastian I'm not sure why it didn't work before, but setting the Font property now works. Maybe the problem was that the box is part of a custom control and that I overrode the Font property of that control to set the box's property. Well thanks anyway. Sebastian why doesnt setting the font property ...Show All
Badhris Loop capture image and generic error occured in GDI+
I've application to capture video of image and grab the still image. It runs well untill I put loop to regrab the still images many times automatically.. and the error (generic error occured GDI+) happend. For your information, I also run different code of application that have similar function which to capture the image repeatedly that I found from internet. However, it give the same error message. I think maybe I've to setup something in the configuration but I still blur about it. I'm using C# Express edition. Could anybody help me please... Hi, This could be the solution. Try releasing the resources of the bitmap you are using in the OnCaptureComplete() method, and to do this correctly you should pass a new bitmap to yo ...Show All
Bazzer Howto include designtime help for a component
Hi! There are quite a many ways to embedd desigtime help to a user of a component; Methods /// <summary> /// Use this to... /// </summary> /// <param name="test">Set to...</param> public void MyMethod(int test) {...} Properties /// <summary> /// Used to ... /// </summary> [Category("MyTab"), Description("Used to ...")] public int Dim { get { return dim; } set { dim = value; } } Delegates /// <summary> /// When succesfull connected... /// </summary> /// <param name="ipAddress">The IP-address...</param> public delegate void Connected_Handler(string ipAddress); [Category("MyEvent"), Description("Trigged when...")] public event Connected_Handler OnConnected; ...Show All
eldiener Datagridview image column
Hi all, I have been trying to get this code to work to no avail The code below I believe should put an image into a datagridview image column , but I could be wrong.. I tried to use byteArrayToImage(e.value) but all it says is systems.drawing.bitmap - it's not giving bytes, it's giving a string. What do you reckon I'm missing to return the byte array Private Sub dgvUsers_CellFormatting( ByVal sender As Object , ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvUsers.CellFormatting Dim _cell As DataGridViewCell = New DataGridViewImageCell If e.ColumnIndex = 1 Then dgvUsers.Columns(e.ColumnIndex).ValueType = GetType (System.Drawing.Bitmap) _cell.ValueType = GetTy ...Show All
Nlepor How to share an object instance through all forms just like vs6.0's global variables?
Now I am doing a c#.net 2005 database project.At the begining, I want to design a login form and after user successfully logon, I will store its account and something else such as Sales Month selected. But I found that c# is purely object oriented language and there is no gloabl varialbe. I wonder how to do this. I have been used to web design and this is my first real winform project(Before only some simple projects). So there are many questions during my design. Another problems: After I new a child window in its Mdi parent, I want to transfer some information to the child, how can I do Now I am trying to define some members and methods to manipulate them in the child form, and so I can invoke the mothods to transf ...Show All
Shady9399 Window class name is not valid
When I create a new WindowsApplication project, add any control to the main form and run the project - I get the following exception on Application.Run(new Form1()); I am using VS 2005 beta2.050215-4400. This haven't happened until now. What went wrong Any help will be appreciated Gabriel The exception data follows: System.ComponentModel.Win32Exception was unhandled Message="Window class name is not valid." Source="System.Windows.Forms" ErrorCode=-2147467259 NativeErrorCode=1400 StackTrace: at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass() at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, In ...Show All
Grifi Can an object determine what class/module it was created from?
I'm trying to create a decision tree without the need to pass or set a property telling the class from where it's being instantiated. I'm talking about UI-less classes. ...Show All
JDCAMP Graphics are being erased by other windows or off screen movement...
I have am working on a program that monitors the download speed of ones internet connection and draws the speed to a graph. The graph is a simple line graph that is drawn using GDI+. The graph is updated in the WebClients DownloadProgressChangedEventHandler. The problem is that when I move a window or move the program off screen, the graph, or the portion that was covered or went off screen gets erased. I have tried doing gc->Save(); (gc=my graphics) but that has not done anything for me. Here is my entire code: (Note that the timer tick event, "UpdateGraph" doesn't do anything, that is fine) #pragma once namespace iDT { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using names ...Show All
FS2K Visual Studio IDE Hangs with Databases that has several Master-Detail Tables....
The Visual Studio 2005 IDE (any version) hangs for a very long time when in a Windows Form project it's added several data components who are comming from a database with several relationships. For example, I have a MSSQL 2005 database, that database has 60 tables, but several of them have a relation with one table. If I want to put all the related tables in a single form (using DataGridViews or another data binding component) the IDE hangs. I can only put like 10 data related tables before the IDE start to hang... Any suggestion using stored procedure and create view for your data may help speed up ...Show All
MartinaL CellFormatting Event Alternative
Hi all, I want to make a change a DgvRow to be "readonly" and "background color" to RED conditionally. I can't use the CellFormatting event because I didn't bind the interested column value to the DGV (I didn't Add that column to the ColumnCollection of DGV). Moreover, I try the _DataBindingComplete event but it fire at least twice because it fire for .DataSource AND .DataMember property change (My code is: dgv.DataSource = DataSource; dgv.DataMember = DataMember; So I can't get the realistic result by using DataBindingComplete event. So what can I do Thanks, ...Show All
