|
Hi Vijay,
Please know that the detault checkBoxes in DataGridView does not have any property to check whether the checkbox is in Checked/Unchecked state. However, on the basis Value property we can check the state in the following manner:
BEGIN CODE
Dim flag As Boolean = False
flag = Me.DataGridView1.Rows(3).Cells(9).Value
If flag = True Then
MsgBox("State is Checked")
Else
MsgBox("State is UnChecked")
End If
END CODE
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi ,
I have got 2 Form .One is have got DataGrid that list my data and Other form have got Crystal Report Objects.I wanna do assign Form1's datagrid datasource to Form2 Crystal Report for show datagrid's data.
i think i need a global variable but i dunno how to do is.Can anyone show me an example or other solutions for this prb
|
|
|
|
|
I am trying to use .NET delegate to make the form responsive while doing data retrieval.
The form contains lots of controls including a tabcontrol with tabpages.
When i Click the Search Button to retrieve the data, i invoke the LoadRecord Delegate and the RetrieveRecord Method was called, but when i click the next Tab Page the form hangs. Can anyone help me with this?
Heres the codes..
frmBase
Code Snippet
Private Delegate Sub LoadRecordDelegate()
Private LoadRecord As LoadRecordDelegate
Protected Sub ExecuteRetrieveRecord()
LoadRecord = New LoadRecordDelegate(AddressOf RetrieveRecord)
LoadRecord.BeginInvoke(LoadCallBack, LoadRecord)
'Retrieving
End Sub
Protected Overridable Sub RetrieveRecord()
'Override this
End Sub
Private Sub LoadCallBack(ByVal result As IAsyncResult)
LoadRecord.EndInvoke(result)
'Done Retrieving
End Sub
frmMyForm
Code Snippet
class frmMyForm
Inherits frmBase
Protected Overrides Sub RetrieveRecord()
Me.SearchRecord(ReferenceNumber)
End Sub
Private Sub SearchRecord(RefNum as String)
'Some Codes to retrieve information based on the RefNum
'Populate the controls(textboxes,comboboxes,etc.)
End Sub
private sub BtnSearch_CLick
mybase.ExecuteRetrieveRecord
end sub
End Class
|
|
|
|
|
Hi,
seems to me you are making illegal cross-thread calls, i.e. accessing Controls by a
thread other than the one that created the Controls.
You can try this in .NET 1.x, or in later .NET versions provided you disable the
cross-thread checkking. Anyway it is the wrong way of doing things, it normally results
in a non-responsive or hanging GUI.
The right way to access Controls from an arbitrary thread is by using Control.InvokeRequired
and Control.Invoke; there is documentation and lots of examples everywhere.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hello there...
I have a windows application in C# 2.0. I have used Crystal Report for printing a bill.I have installed a dot matrix printer.
So how to set the page setup option so that it'll print till the data is there.(e.g in a shopping mall the bill is printing till the data and after that it stops printing).
Its urgent...pls help
--Krish
prfkrushna@gmail.com
|
|
|
|
|
first: all questions on the forum are urgent.
second: I do not understand all parts of your question.
You start to print, request data and than print the data?
Is that your problem?
|
|
|
|
|
Hi,
I have a datatable with 3 expression column bind to datagridview with a bindingsource but the column are not displayed in the datagridview.
when i debug, it was throwing a StronglyTypedException and the innerexception is InvalidCastException "can not convert dbnull to decimal".
Please help.
Thanks in Advance
Lookman
|
|
|
|
|
|
Please don't cross post.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi to all forums members,
How to Add click once feature for windows Class Library application?
I have a window class library application, Is it to possible to publish the class library application through click
once feature of dot net..
I have not found any options for the class library application to add auto update feature..
Or any other option any one know, pls guide me ....
Vishnu Narayan Mishra
Software Engineer
|
|
|
|
|
Vishnu Narayan Mishra wrote: pls guide me
Ok.
If Google is not working at your location then complain to your ISP
led mike
|
|
|
|
|
hey !
m having problem in vb.net (gdi+) for which if can please help me
Problem :
m drawing a rectangle using ControlPaint.DrawReversibleFrame() function. but after completing with that drawing how can i select that n resize that same rectangle ???
Thanx in advance
|
|
|
|
|
By keeping track of where you drew it and handling mouse events so you can redraw it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have tried to do that using region and mouse events but im having error regarding region class.....
Brijal Patel.
|
|
|
|
|
Well, it's hard to know what you're doing wrong if you don't post the code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sorry im nt having code at this time.... It's at my working place...
Let me exaplain u the problem briefly,
Windows form is my canvas... i hv written code to draw a rectagle at runtime using mouse.... now suppose i have drawn 2 -3 rectangle...
now i want to resize the previously drawn rectangle... for this problem i hav tried to use region class to check whether mouse click point is on specific rectangle or not..... but im havin problem with those stufs.........
if u can help me out to write the code how to select that rectangle again n resize....
Brijal Patel.
|
|
|
|
|
When you're at work, post your code, then I can tell you what is wrong with it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am using VB2005 to write an addin for Autodesk Inventor 2008, and I am having trouble understanding one part of the code that I have seen is some sample addin's posted by Autodesk.
When an addin loads it gets access to the running instance of inventor, thru an Activate method.
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
' This method is called by Inventor when it loads the AddIn.
' The AddInSiteObject provides access to the Inventor Application object.
' The FirstTime flag indicates if the AddIn is loaded for the first time.
' Initialize AddIn members.
m_inventorApplication = addInSiteObject.Application
When I create a form in the designer I believe I want to access this same running instance, so I declare a variable. How do I assign the invApp variable the same inventor application from the Activate method?
I feel there is something very basic here that i am missing.
Imports Inventor
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim invApp As Inventor.Application
End Sub
End Class
If anyone can answer or direct me to something that will help me understand this.
Greatly appreciated
|
|
|
|
|
warped208 wrote: m_inventorApplication
this is a member variable, you should access it directly from your form. I see no reason for it not to be static, there will be only one.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a datagridview. I want to allow users to right click on any record. When they right-click, they will get options like Add/Delete...etc.
Can you provide a sample code or external link to an example in c#?
|
|
|
|
|
Hi,
In order to achive the desired behavior you need to add ContextMenuStrip on the form. Then you need to add the MenuItems for the context menu and write code for the respective MenuItem (i.e., for Delete or ADD). Then you can attach the ContextMenuStrip to your grid on FormLoad (or any other event as per your requirement) in the following manner:
BEGIN CODE
this.dataGridView1.ContextMenuStrip=this.contextMenuStrip1
END CODE
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
have a textbox and in that i want to disable copy paste option of the user in window application using vb.net. Please let me know the solution
|
|
|
|
|
You will need to handle keyboard events such as KeyDown/KeyUp and/or KeyPress. In the event handlers check if ctrl+v or ctrl+c is pressed. You will also need to make sure that user can't open context menu of the textbox.
Giorgi Dalakishvili
#region signature
my articles
#endregion
modified on Monday, March 24, 2008 3:37 AM
|
|
|
|
|
Hi,
I have a MDI application and I want to get the child form which is currently in focus/on top/being used.
I've tried using logic like this to loop through all the MDIChildren:
<br />
array<system::windows::forms::form^>^ children = this->MdiChildren;<br />
for each (System::Windows::Forms::Form^ form in children){<br />
if(form->TopMost){<br />
System::Windows::Forms::MessageBox::Show(form->Text->ToString());<br />
}<br />
}<br />
</system::windows::forms::form^>
but it doesn't work.
|
|
|
|
|
I guess you should access the form's Active proprety
|
|
|
|