|
You can set the DataGridview enditable. In the Save button handler code get the edited data from the grid and updated into the database.
Manoj
Never Gives up
|
|
|
|
|
something like below:
dataGridView1.SelectedRows[0].Cells[0].Value will give you the valuse of cell#1 from the 1st row selected.
Manoj
Never Gives up
|
|
|
|
|
when i am assigning it to a textbox like
txtcuscode.Text= dataGridView1.SelectedRows[0].Cells[0].Value;
shows an error message like this following..
Cannot implicitly convert type 'object' to 'string'.
plz help me recover this and thanks a lot for the code.....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|
|
cast "dataGridView1.SelectedRows[0].Cells[0].Value" to a string.
Manoj
Never Gives up
|
|
|
|
|
casting done to string...
but error appears...like
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
the error is at this line...
txtcuscode.Text= Convert.ToString(dataGridView1.SelectedRows[0].Cells[0].Value);
the error handler points to the property text of the textbox...
help me overcome this..
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|
|
thanks for ur help
finally i did it....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|
|
i am newbie to the C#, and i don't know which using directive is to use for "SecureFileElement".
i am getting the error as-
"Error The type or namespace name 'SecureFileElement' could not be found (are you missing a using directive or an assembly reference?)"
any help is much appreciated.
Thanks in advance.
by ULZ
-- modified at 2:00 Wednesday 6th June, 2007
cheers
ULZ
|
|
|
|
|
SecureFileElement is not a class in the .NET framework, according to google.
http://www.paulusevan.net/default.aspx[^] is the only reference to this class name I can find online. He's creating a custom config entry.
I recommend getting a handle on C# before you start trying to copy and paste code from the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
thanks for ur quick reply.
Your recommandation is obious but i don't have that much time to get handle on C# for resolve this problem.
I am side by side reading the C# professional book.
U plz suggest any other book to get handle on C#.
tahnks u very much for ur help.
by ULZ
|
|
|
|
|
ulhas555 wrote: Your recommandation is obious but i don't have that much time to get handle on C# for resolve this problem.
To resolve this problem, get the code that defines this class into your project. But, given that this code relates to security issues, I'd worry deeply about having my security code written by someone who is copying code off the web and posting in online forums about how to make it work.
ulhas555 wrote: U plz suggest any other book to get handle on C#.
Inside C# is a good book, if out of date.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I have the following doubts in message queue processing
1. Is there any possibility to sort out the message queue according to the priority and other category?
2. Can i add more body to a single message?
3. Is there any provision to read the message without removing it from the queue i.e. peek in file manipulation?
4. Can i use public queue to write the messages and to read the messages from the other system.
Plz help me in order to make my program innovative
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: 1. Is there any possibility to sort out the message queue according to the priority and other category?
No. You can however put in your own logic by peeking into all messages and moving the messages to a custom queue according to its priority.
M. J. Jaya Chitra wrote: 2. Can i add more body to a single message?
No
M. J. Jaya Chitra wrote: 3. Is there any provision to read the message without removing it from the queue i.e. peek in file manipulation?
Yes. The Message class also has a peek method.
M. J. Jaya Chitra wrote: 4. Can i use public queue to write the messages and to read the messages from the other system.
Yes. That's what public queues are for.
SG
|
|
|
|
|
Thank you so much, now only i got the idea by searching through the net that it automatically sorts according to the priority.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi
I am using Visual Studio 2005 and C# to develop a windows application. I am binding a DataTable to a ComboBox. What I am trying to do in the ComboBox control is to keep track of the text the user enters in the editable part of the ComboBox. I am using the TextChanged event of the ComboBox and each time the text change I want to use that text and query the DataTable and repopulate the ComboBox with all the names that start with that text. I problem I am having is that I also want to open the dropdown part of the ComboBox programmatically when the TextChanged event of the ComboBox fires so that the user can see which names start with his input and then it gives him the chance of selecting a name rather than typing the rest. I tried using the following code in the TextChanged event:
comboBox1.DroppedDown = true;
It does open up the ComboBox, but the mouse pointer disappears then as soon as the pointer enters the windows form that the ComboBox is on. When I try the code inside a button Click event it seems to work fine and the mouse pointer remains visible. Is this a bug in Visual Studio and is there a remedy for this?
Kobus
|
|
|
|
|
Hi,
Alternatively, you can use a combination of a TextBox and ListBox to create a control and implement your requirement. Normally the Listbox will be hidden, and conditionally will be populated with the names that start with the text entered by the user in the Textbox.
Manoj
Never Gives up
|
|
|
|
|
you should try these properties:
AutoCompleteCustomSource, AutoCompleteMode and AutoCompleteSource ie.
assign your dataTable to AutoCompleteCustomSource property of the combobox, select desired AutoCompleteMode and set AutoCompleteCustomSource to CustomSource..
life is study!!!
|
|
|
|
|
Thanks
Will try your suggestions immediately. It seems much easier than I anticipated.
Kobus
|
|
|
|
|
Hi,
I am working in a project, where It is necessary to create a "System folder" in explorer with different columns and the BackGround of that folder must be different in it .
How Can I create it using C#?
Thanks
Ramesh
|
|
|
|
|
hi ,
i am having a delete button for each row how can i delete the row on the button click
thanks
|
|
|
|
|
You can get the current row in which button has been clicked and get that row deleted.
Manoj
Never Gives up
|
|
|
|
|
Find index of the row and delete the row .
hello every one
|
|
|
|
|
Hi all
Can anyone tell me how to get a value from other forms?
For example, I have two forms on the project, Form1 and Form2. And I have a textbox and a button on Form1, when clicking the button, Form2 opened with a listbox on it. The problem is I want the selected item on the listbox shown in the textbox on Form1, can anyone hepl me this?
Thankz advance
|
|
|
|
|
You can expose values as properties, or pass them using delegates.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Can you give more explaination about how to do it with delegates?
Thankz
|
|
|
|
|
This[^] should do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|