|
hi all
i am new in c#
i work on database program that view the data in datagrideview
i use the datagrideview to add , update values of the database
but i have problem
how can i check the value enterd in the datagrideview
(i need the value to be only integer)
i used this code
datagrideview1.rows[index].cells[index].valuetype=int
but it is not work
please help
BE OR NOT TO BE
|
|
|
|
|
if you're using .net 2.0 you may use the TryParse() function of the inbuilt integer class.
int myparsedresult;
if (int.TryParse(datagrideview1.rows[index].cells[index]), out myparsedresult)
{
// The fieldvalue is an integer... myparsedresult now holds the value of the field (as int)
}
if you're using .net 1.1 there could be a function like "IsNumeric" and some others.
you also could use regular expressions to determine whether a value is an integer or not.
googling for "c# regular expressions" will give you a lot of hits
//edit: i forgot the second parameter of tryparse.. its a integer variable where the parsed input is put in.
|
|
|
|
|
hi
how are you all
muhammad mahmood ilyas
|
|
|
|
|
i would say its a path to somewhere. it lloks like the wmi structure but i think if you will post such a question the third time, you won't get an answer - use google to get an answer for such questions because it is not THAT complicated neither hard to find...
|
|
|
|
|
Can anyone help me to show a TreeView having Node as a Text(may not be editable) & a ComboBox (at fixed position)?
Each TreeNode will have ComboBox having same Items.
Can anyone help me?
|
|
|
|
|
i think even an inherited treeview would not be that customizable. i guess you won't get around a custom control. googling for "c# custom control" will give you a lot of hits.
|
|
|
|
|
hi;
if i make a checkboxcolumn in my datagrid, and run it i cant check or oncheck the boxes
i can set the value behind it so it would check when the cell has that value but i dont work like that.
i want to use the checkboxes so that the user can select it and so select the entire row
after this he can push the delete button
does anybody know some good links with examples??
thxx
|
|
|
|
|
|
hi all
plz tell me hurriedly
muhammad mahmood ilyas
|
|
|
|
|
|
to specify that which event handler is attached with particular event
rahul
|
|
|
|
|
Hi
in C# how can i get the size of a file
Parshant
|
|
|
|
|
hi,
IO.FileInfo myfile = new FileInfo("c:\myfile");
myfile.Length // this is the size in bytes if i remember right...
|
|
|
|
|
hi
iwant to save my app setting (for exeample color,connectionString and ...) in app.config and retrieve it later .. how to do ??
thanks ..
|
|
|
|
|
What version of the framework are you using ?
The app config is just an XML file, you can write to it as such, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
u can add information to app.config by following way
< add key="color" value="red"/ >
and can retrive the value by
ConfigurationSettings.AppSettings["color"]
rahul
|
|
|
|
|
|
Hi friends,
I had planned to block access of other in my computer.Using bios how can i do that in c#.net.How to access and alter bios status of computer.Also Is it possible to do that in system information toolin XP
Gnanas
Gnanas
|
|
|
|
|
what exactly do you want to change? Afaik you are not able to change anything within the bios from the operating system... i even don't know anything else than the password protection for any "bios-protection-purposes". What do you mean when talking about the bios status? there is nothing like that. the bios is the "basic input output system" and provides some basic functionality for the "users" (by users the os devs are meant .
There are some "new age" bios (i forgot the name) which are entirely written in c or cpp (dont remember any more) - Afaik they are programmable though i don't know what "programmable" exactly means...
Please just clarify your question because i didn't get the point
|
|
|
|
|
mikone wrote: Please just clarify your question because i didn't get the point
Some new mobos provide a windows tool to update the bios instead of requiring users to try and find a floppy they can boot to do the same. I'm not aware of any windows APIs to do so, and would assume that the access is done via proprietary means via the motherboard drivers.
|
|
|
|
|
hi
i am working on a project which has a few capabilities of circuit maker
can someone help me making a line in c# such that it can be stretched and compressed, can be deletd, moved,etc
thanks in advance
Sameer Sood
|
|
|
|
|
If the line is persistent, you need to draw it in your OnPaint. IF you want to draw a drag line that will disappear, you can use CreateGraphics to do it. You're going to have to handle all your mouse events, and call Invalidate() to force a paint event, if you're going to draw in OnPaint.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
tnx for the reply bt i also understand that some events have to be handled, bt the question is how, and wat role does onpaint play here
Sameer Sood
|
|
|
|
|
Well, onpaint is where drawing happens, and you want to draw a line, right ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok that is clear bt how to move it and give it funstion like press delete key to delte it and enable selection on it and make it stretchable
there are lots of questions, tell me the methods and strategies , i have no idea.
Sameer Sood
|
|
|
|