|
Hi,
how i can validate a formula.
Formula contains columns of table and operators.
if suppose c1,c2,c3 are columns of table, c1 is of type string, c2 is decimal and c3 is int.
formula may be a+(b*c),or a*(b/c). I need to validate that formula. how i can
approach.if any one had done this plz send me the required code.
lakshmi
|
|
|
|
|
Please clarify what a, b, and c are. Are they c1, c2, and c3, respectively?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Yes. a,b,c are c1,c2,c3 respectively.
|
|
|
|
|
hi all,
i am using data grid view in my windows application, where in which i have a checkbox for every row it generates
my problem here is i should find out whether the check box is checked or not?
on grid clicked event..
my purpose is i need to select all the row's values of checked checkbox
hope its understood
, please help me
prashanth
|
|
|
|
|
Hi Prashanth,
You can do the following: (case: if using data Binding)
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if ((bool)row.Cells["select"].Value.Equals(true))
{
//Do Something
}
}
In the above case the DataGrid is bound to the following table:
private DataTable Table()
{
DataTable table = new DataTable();
DataColumn col1 = new DataColumn("select",Type.GetType("System.Boolean"));
DataColumn col2 = new DataColumn("Name", Type.GetType("System.String"));
table.Columns.Add(col1);
table.Columns.Add(col2);
DataRow r1 = table.NewRow();
r1["select"] = true;
r1["Name"] = "Something";
DataRow r2 = table.NewRow();
r2["select"] = false;
r2["Name"] = "nothing";
table.Rows.Add(r1);
table.Rows.Add(r2);
return table;
}
Hope that helps.
Cheers
|
|
|
|
|
thnx Mr.RepliCrux
but my question is!
i need to catch whether the checkbox in the grid or checked or not as soon as user checks any checkbox of grid.
hope u got me
please help me
thnx
prashanth
|
|
|
|
|
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
foreach (DataGridViewColumn column in dataGridView1.Columns)
{
if (column.CellType == typeof(DataGridViewCheckBoxCell))
{
//Do Something
MessageBox.Show((string)dataGridView1.Rows[e.RowIndex].Cells[1].Value);
}
}
}
This one will do the trick
|
|
|
|
|
Thanks again Mr.RepliCrux
but for the last statement
e.rowindex.cells[1].value
its giving object reference is not set to instatnce of object exception.
FYI i am using VB.Net does it makes any change/diff here?
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
For Each column As DataGridViewColumn In DataGridView1.Columns
If column.CellType Is GetType(DataGridViewCheckBoxCell) Then
MessageBox.Show(CType(DataGridView1.Rows(e.RowIndex).Cells(1).Value, String))
End If
Next
End Sub
This is how Vb.net code looks, The error you are getting might be because:
1. Your parser is going in that code before your datagrid is initialised.
2. I have said Cells(1) because there is some value in my Cell(1) in that row position. If there
is no Cell(1) in your datagrid you will get that exception
|
|
|
|
|
Thnx for ur reply
but the thing is,
i need to catch the checked state of checkbox of grid.
i mean like a normal checkbox (to which we can catch checked state)
i need to do for grid's check box
hope u got me
FYI i am using VB.Net2.0
thnx in advance
prashanth
|
|
|
|
|
Hi Prashanth,
The code I gave you was for your understanding how to catch the event when you click on the checkbox cell.
For Each column As DataGridViewColumn In DataGridView1.Columns
If column.CellType Is GetType(DataGridViewCheckBoxCell) Then
Dim chkCell As DataGridViewCheckBoxCell = CType(DataGridView1.Rows(e.RowIndex).Cells(0), DataGridViewCheckBoxCell)
If CType(chkCell.EditingCellFormattedValue, Boolean) = True Then
MessageBox.Show("Yes")
Else
MessageBox.Show("No")
End If
End If
Next
This works for me, cheers
|
|
|
|
|
i need to learn how can i set my program always on top that located on left top of
my desktop( location x,y=0,0) but all menues of other windows and desktop icons
set bottom of my program, i want to learn how to do this in c# .net
( my UI is a tool bar only..!!! )
|
|
|
|
|
Online articles generally simplify the use of an ADO connection to populate single comboboxes. I am looking for something where I can see the implementation of multiple tables (in the same database) being bound to multiple objects on a windows form.
Also, if you have multiple tables that you are retrieving/storing data from/to is it better to have each combobox loaded with data in its own function/sub or is it better to do it all in one function/sub?
Thanks,
Dan
|
|
|
|
|
Multiple tables in a combobox can be done through queries or stored procedures...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i am using dotnet 2003.i want to move records using firstbutton,previous button,next button,last button in vb.net windows application(not web application).
|
|
|
|
|
Store the record number you use to read a record, and change it ( and read the right record ) when you press a button.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You can use custom paging, just like in web application create the stored procedure which takes current page and number of recored to be displayed. On each button click bind the control with the new data.
|
|
|
|
|
how can i checkout a file by using a command line in vssafe 2005
|
|
|
|
|
hi all
we are developing a Windows project in my organization and we are using Visual SourceSafe to overcome integration issues,etc...
but my problem here is
when i created working folder and get latest version and
when working on checkout mode of a perticular form
My Machine is going slow....(i mean here everytime the changes made to form are saving in VSS-I guess)
what will be the solution to make faster,
do i have any other mode to use checkout option istead.
please help me
Thanks in advance
prashanth
|
|
|
|
|
No everytime you make a change it saves to the local hard drive, the changes arn't put back into VSS until you checkin.
|
|
|
|
|
I am developing virtual printer driver In window vista operation system which run under spooler service.
Now i want Process List of currnt login user from my this printer driver
Or
we can say that i want Process list of current login user from window service
i got the current user session id from WTSGetActiveConsoleSessionId() API
now how can i get the process list of this active session my Window serivice i got idea
that using WTSQuerySessionInformation get the application name running user session
but i dont know how to use this function help me.
Some more on problem
that my Printer driver DLL is one serice which
run in session 0 and user run in session 1 , session 2 and so on.. In
window vista operation system.
now i want process list of user session means i want a process list of
session 1 from session 0, is it possible in VISTA if yes then HOW
please help me...
Any comments are welcome..
Kalpesh.
-- modified at 4:28 Wednesday 27th June, 2007
|
|
|
|
|
kalpeshgedia wrote: Now i want Process List of currnt login user from my this printer driver
WHY?? What on earth does a printer driver need to know about the processes running on a system?
A printer driver has but a single mission in life. Convert drawing commands from GDI/GDI+ to a language used by a printer to describe the same image on a page and communicate status information from the printer back to the spooler. That's it. Nothing else.
Are you installing this "driver" through "Add Printer..." or is this an .EXE your writing? If it's an .EXE, then it's not a printer driver you're writing.
|
|
|
|
|
hi all,
i want to validate text box of my windows form to a email format
i mean i want to validate my windows text box to standard email format
i didn't found the regular expression validator in windows vb.net
i came to know that i need to use ^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$
but where do i need to use( to which property of the text box)
please suggest me clearly
thnx in advance
prashanth
|
|
|
|
|
There is no property of the textbox that uses this. You have to handle the Validating event of the TextBox and run a RegEx match of the contents of the TextBox against the RegEx expression you have. YOU have to provide the validation code. It doesn't come standard in the TextBox.
TextBox.Validating event docs[^]
|
|
|
|
|
Its pretty rude to post the same question twice, especially when people have taken time out to provide you with a possible solution.
If you dont agree with an answer just say so rather than re-post the same query. Id say your best bet is to google it because three people have given you the same answer so far.
|
|
|
|