|
|
Hi,
I am adding 4 dynamic datagrids to my webform. all columns are bound columns.
do i need to add template columns if i want to do inline editing. how do I do this.
I need the datagrid row to open up into edit mode with the textboxes so that the users can edit the data.
how do i capture which datagrid row is clicked.
please help me with this.
Thanks,
Soujanya
|
|
|
|
|
Hi all,
Here's my problem. I have an MDI but I don't want the user to be able to open more than one instance of a form at a time. I have written the following function. I think I am close but this still allows more than one instance open at one time or in other words allways returns False:
Private Function checkExistingForm(ByVal frm As Form) As Boolean
checkExistingForm = False
Dim frmArray() As Form
frmArray = Me.MdiChildren()
Dim frmArrayLength As Integer
frmArrayLength = frmArray.Length
Dim i As Integer
For i = 0 To frmArrayLength - 1
If frmArray(i) Is frm Then
Debug.WriteLine(frmArray(i))
checkExistingForm = True
Exit For
End If
Next
End Function
I call the above function in this code:
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
If e.Button Is Me.tbStock Then
Dim stockForm As New Stock
If Me.checkExistingForm(stockForm) = True Then
Exit Sub
End If
stockForm.MdiParent = Me
stockForm.Show()
End If
end sub
Any help would be greatly appreciated.
|
|
|
|
|
Hi ,
Check out this one..........................
Private Function IsFormOpen(ByVal OpenForm As Form) As Boolean
Dim intOpenForms As Integer
Try
Dim formExists As Boolean = False
For intOpenForms = 0 To MdiChildren.Length - 1
If MdiChildren(intOpenForms).Name = OpenForm.Name Then
formExists = True
MdiChildren(intOpenForms).Activate()
Exit For
End If
Next
Return formExists
Catch exc As Exception
Throw exc
End Try
End Function
Private Sub ToolBar1_Buttonclick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonclickEventArgs) Handles ToolBar1.Buttonclick
If e.Button Is Me.tbStock Then
Dim stockForm As New Stock
If IsFormOpen(stockForm) = True Then
stockForm.Dispose()
Exit Sub
End If
stockForm.MdiParent = Me
stockForm.Show()
End If
end sub
Hope this will help u..............................:->
Ritesh
|
|
|
|
|
Thanks Ritesh,
That worked great.
Mark.
|
|
|
|
|
in a accountancy project i have to print some reports from a dotmatrix (OKI 321 ML) printer. But it doesnt work. The same code works while printing in a deskjet or laserjet printers.? what s wrong? any idea? thanks a lot.
|
|
|
|
|
Greeky Creek wrote:
what s wrong? any idea?
Not without seeing your code, what your trying to print, and how your trying to print it. Are you trying to print straight Text or are you trying to print the contents of a RichTextBox, graphic image, what?
Since your using a dot matrix printer, your going to find a very small base of developers who still use one for any purpose, and hence, a small pool of developers who can help you with this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
good afternoon.
i'm currently using vb.net and sql server.
i just want to ask advice or guidance on how to save microsoft office documents(.doc,.xls,.vsd,.ppt), text files, and html documents, etc. in the database and if i open one of the files, example is a word document, the document will open in the same format as in the ms word.
what appropriate tools should i use? i'm thinking of the saving pictures in blob format but i don't if it is applicable...
thanks in advance...
|
|
|
|
|
Hi,
If u r thinking to save Files in dB than better u set Column's datatype as image........
u can easily convert the file into array of bytes as
Dim reader As New FileStream(strFileName, FileAccess.ReadWrite)
ReDim pi_arrbyteFiles(reader.Length - 1)
reader.Read(pi_arrbyteFiles, 0, pi_arrbyteFiles.Length)
reader.Close()
When u want so save the file back on the m/c u can call
Dim strWrites As FileStream
If File.Exists(strFileName) Then
File.Delete(sfdFile.FileName)
End If
strWrites = File.Create(strFileName)
strWrites.Write(pi_arrbyteFiles, 0, arrbyteFiles.Length - 1)
strWrites.Close()
End If
Regards,
Ritesh
|
|
|
|
|
good morning...
thank you very much for the advice...
more power...
|
|
|
|
|
|
good morning...
thank you for sharing me the site.....
|
|
|
|
|
Hi, can any one tell me how to prevent the right click on the combobox or textbox??? I can prevent the user from typing by using keypress event, but I could not prevent the user from right click and paste the value to override my value in the combobox or text box.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Quick and easy TextBox1.ContextMenu = New ContextMenu , otherwise you will have to inherit from the TextBox and Override the WndProc method. To intercept the paste:
Public Class MyTextBox
Inherits System.Windows.Forms.TextBox
Protected Overrides Sub WndProc(ByRef m As Message)
'Call base method if not the paste message
If m.Msg <> &H302 Then MyBase.WndProc(m)
End Sub
End Class Hope this helps
Tom
|
|
|
|
|
|
I need to pass a string value into an window form app where the string will be used to validate wheather the form should or should not be shown/loaded base on a hardcode ID. How should i do it?
ANd what command should i type if i wish to test run in Start->Run
|
|
|
|
|
You don't need to do anythign special to pass parameter to the exe.. just call like this:
myExe param1, param2, param3
inside your exe, your must look for command line parameters and take appropriate action.
----------------------------------------------------------------------
T Manjaly
My C# Tutorials articles www.dotnetspider.com
|
|
|
|
|
i see okiee thankzz for the tips
|
|
|
|
|
Hello ,
i know this seems crazy to ask ,but better ask then assume, i have a project to finish and programing it's not for me , can someone help me with this?
here is what i need to get done:
that the form contains multiple group boxes, DateTime Picker controls, and a NumericUpDown control.
The cost of a hotel room is based on the following rules:
• The base rate for the room depends on the room type. Standard = 84.50, Deluxe = 104.50, and Suite = 154.50.
• If the number of guests is greater than 2, a $10.00 charge is imposed on each additional guest per night.
• An additional rollaway bed costs $5.00 per night.
• Declare constants as necessary to store the various rates.
• Using the rules described in the previous list, write the code to calculate the cost of the hotel room and display the output. Format all of the output. Make the Calculate button the accept button.
• The Clear button should clear all of the output values, set the arrival and checkout date to the current date, and set the room type to standard. Remove the check from the Additional Rollaway Bed check box and, finally, set the default number of guests to 2.
• and the code for the Exit button to exit the solution
|
|
|
|
|
bdobruna wrote:
programing, it's not for me. Can someone help me with this?
No, not without a personality transplant.
Why does everyone expect help with code when all they do is copy and paste the homework assignment? You're going to have to start the code yourself. If you have specific questions on the code or language, we'll help with that. We won't write the project for you.
|
|
|
|
|
I didnt ask you to do the project for me i only asked for some help to start just like the friend below gave me an idea, but thank you anyway.
Benny
|
|
|
|
|
The list of tasks you must do is nicely broken down already so it should be easy to go through this and complete each item and check it off your list.
So, create your form with the various controls on it. Give the controls sensible names (don't just keep the defaults like TextBox1 or Label1 and so on).
You can double click on a control in the designer to get the default behaviour. If you double-click a button Visual Studio will create a Click event handler for you. (If you have given your controls sensible names the event handlers will get sensible names).
The creation of constants[^] is a trivial thing. Personally, I'd store values like this in the database (Sales and Marketing departments like to change things, give special deals to get people in the door and so on) - but since this is not a real world application, constants will serve just as well.
The maths to discover the rate is simple high school maths: (numberOfNights*roomRate)+(numberOfNights*extraGuestCharge*extraGuests)+(numberOfNights*rollawayBedCharge*numRollAwayBeds)
So, now you should have a starting point. Get going, and if you get stuck on doing something get back to us and we can help you on specific items.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
What a terrific answer, I would have loved somebody to show me how to do homework this well when I were a lad
I would have been all for an answer like this had the O.P shown some enthusiasm, but really what we got was
have a project to finish and programing it's not for me (readas: I cant be bothered to look back in my textbook about how to do each of these small tasks)
Oh well, Im sure he/she can get this homework done now and get onto something more fun for him/her
|
|
|
|
|
I gave you 5 to counter that 1 you got.
I believe that the O.P only asked for code instead of help with the project, which in my opinion may only take 1 to 2 days even for a starter.
The list he/she gave is nicely written unlike the request he made, so I'm assuming he/she just did a copy and paste from the assignment notes.
Reminds me of a friend who always asked for help only when an assignment is due that day. He asked for help in 'explaining' on how to do a project but in the end I did most of the work since he knew next to nothing.
Edbert P.
Sydney, Australia.
|
|
|
|