|
Hi all,
In the current project I working on, on one form I'm using a datagridview control to display some rows from a strongly-typed dataset DataTable. In the application, there is the possibility that some rows displayed in the datagridview are deleted in background. under normal conditions, the rows should disappear from the datagridview (which happens), but I need to keep them in datagridview for display until the user decides to close the form.
Additionaly, for the datagridview I perform some custom painting of the row (in CellFormatting and RowPostPaint events)...
in order to "disconnect" my gridview from the bindingsource and keep my deleted rows for displayed I tried to use the following code:
myBindingSource.RaiseListChangedEvents = false;
myBindingSource.SuspendBinding();
But, this doesn't help: I keep getting an exception dialog message with the message:
Exception: System.Data.RowNotInTableException: This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.
How can I achieve what I need to do? Is it possible to keep the data in the gridview although the rows were deleted?
Thank you in advance!
Andrei
|
|
|
|
|
"Steve Ballmer will deliver the keynote at Microsoft Tech-ed India 2009 Conference in Hyderabad. There will be announcements related to Windows 7, Silverlight 3, Microsoft Surface Computer, Tata Nano, IPL, etc. and Microsoft will also provide free certification to all onsite attendees.
What: Microsoft Tech-ed India 2009
Where: Hyderabad
When: May 13-15, 2009
Register:http://www.microsoft.com/india/teched2009
There is also a ""Top Architect"" contest being organized. http://virtualtechdays.com/toparchitect/default.aspx
|
|
|
|
|
It's taken you 2 years to post your first message and then you cross post to six forums at once. Very rude. No cross posting!
|
|
|
|
|
Hello.
Is it possible to authenticate windows form using a cookie ?
An application provides cookie, that i wish to use in my forms project to authenticate and use the credentials, basically looking impersonate using cookie.
Really appreciate if someone can shed some light.
Harry
Before c# there was darkness
|
|
|
|
|
This sounds highly suspicious.
I'm not sure that I would appreciate somebody stealing my work, which is what your post sounds like you are doing.
Of course you might not be doing so. Without further explanation it is impossible to tell.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Which work of yours are you talking about. Have you published any such solution ?
Before c# there was darkness
|
|
|
|
|
No. You misunderstand.
Your OP was worded, to me at least, as though you were attempting to use the work of someone else (the cookie) for your own purposes.
This sounds, again to me, a bit suspicious. The sort of thing a virus program might try to do, for example.
I am probably totally wrong about that, but I was trying to suggest to you that a more detailed explanation of what you are trying to do, might get more responses.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Duh!
Our intranet webserver intentionally provides a cookie for internal purposes and i wish to use this as windows authentication token,
Wondering if this is possible.
Before c# there was darkness
|
|
|
|
|
Ah. I now understand.
I regret that I am unable to help you, but I hope that someone else will.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hmm seems like an IO issue - finding the cookie folder may be a challenge. I'm pretty sure you should be able to read and parse the cookie in a winforms app. Is there a namespace aspx uses for it's helper functions, you may need to reference that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hello.
I have a DataGrid with a DatagridBoolColumn and DatagridComboboxColumn. I need to hide the DatagridComboboxColumn when the value of DatagridBoolColumn is False. Is there a way to do this?
Please help me!
modified on Tuesday, April 28, 2009 2:22 AM
|
|
|
|
|
DatagridComboboxColumn.Visible = false;
try that
modified on Tuesday, April 28, 2009 7:14 AM
|
|
|
|
|
hopingToCode wrote: DatagridComboboxColumn.VisableVisible = false;
Fixed that for you.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you getting to lazy and relying on inti sense
|
|
|
|
|
hi..
this single line code will do..
DatagridComboboxColumn.Visible = false;
"DatagridComboboxColumn" this will change according to the name of column u set.
with
rgrds
ageesh M
|
|
|
|
|
Hello,
For several applications I've written, I use a TrackBar and a TextBox to modify a particular value. I want these controls to be synchronized, so when the TrackBar is scrolled, the value in the TextBox is updated, or when the user types a value in the TextBox , the TrackBar automatically scrolls. Also, I typically want to fire an event when the value of this field is modified. Right now I'm using the ValueChanged event for the TrackBar and the TextChanged event for the TextBox , like so:
private void trackBar1_ValueChanged(Object sender, EventArgs e)
{
textBox1.Text = trackBar1.Value.ToString();
DoSomething();
}
private void textBox1_TextChanged(Object sender, EventArgs e)
{
int value = trackBar1.Value;
if(int.TryParse(textBox1.Text, out value))
{
trackBar1.Value = value;
}
}
private void DoSomething()
{
}
Is this the correct way to handle this situation, or is there a better way?
Thanks,
Dybs
|
|
|
|
|
Hi,
some of the .NET Controls (and I can't remember which) do fire a Changed event when data gets assigned even when the new data has the same value as the old one (so it wasn't really changed).
Therefore it is a good practice to have an if(newValue!=oldValue) {...} around the entire content of the Changed handler (which also means you have to remember the old value in a class member).
Calling DoSomething() from only one handler should then be sufficient to make sure it gets called only once for each real value change.
|
|
|
|
|
Luc,
My experience with TextBox and TrackBar (the only 2 controls this has been an issues for me so far) is they only fire the Changed event when the value actually does change. Although I left it out in my previous post, in my production code for the TextChanged handler, I do check
int textVal = int.Parse(textBox1.Text)
if(trackBar1.Value != textVal)
{
trackBar1.Value = textVal;
}
Thanks,
Dybs
|
|
|
|
|
hi everybody.pleeeeeeeeease help me! i am working on a real project that i need to read data from a serial port(com) and draw some graphs.the data are comming from a device that measures decible of the room.i have some questions and problems as it is my first project:
1.in windows application , in C#,how could i read the data?which code should i use?
2.what is the type of data that i get?is it binary?i do not know about rs232.
3.could i test my project in visual?i mean ,should i really connect the real device to get data or i can use the "serial port control " that is in tools>components and not use the real "com" port ?if so tell me how plz.
thanks.
|
|
|
|
|
Hi,
the SerialPort class is what you need to communicate with your device over RS232C.
The communication will use whatever format the designers of your device have chosen.
Sending data is the easy part, receiving it is more difficutl as it will arrive asynchronously, which means it gets in in bursts that don't necessarily follow the borders of your messages, and it will be received on a separate thread, so you will need Control.InvokeRequired/Control.Invoke pattern.
IMO If you are new to programming, this would not be a good idea for a first project.
|
|
|
|
|
thanks but as i said i "have" to do this an i really want info in details.please someone help me.what should i do from the first?
regards
|
|
|
|
|
As Luc mentioned above, the .NET SerialPort class is what you want to use. Depending on how your device is sending data, you may be able to use the various Read methods (Read, ReadLine, ReadTo, ReadByte) . I would suggest reading the MSDN documentation[^]. The bottom of the main Serial Port page has a sample app in C#, and below that is a link to "Serial Port members". This will list all the functions and properties available to you. Each function has VB and C# examples that should help get you started.
Dybs
|
|
|
|
|
dear frenz,
i hav a grt problem here.
i am working on a windows application where i need to open a form2.vb to search records, which should be displayed on form1.vb.
the problem is dat i hav to use 2 data sets in order to navigate among the searched records.
how do i design my application so that without using multiple data sets, i can search records in 1 form/window and the results r displayed in anoder window.?
this is wat i want to accomplish:
1. form1.vb has various textboxes and other controls to display record fields.
2. when click on "search" button on form1.vb, a new window/form ie. search.vb opens up.
3. user enters search criteria on search.vb and cliks on the "find" button.
4. after find button is cliked, the "search.vb" form closes and the searched records are displayed on form1.
problem1: the problem lies ind fact dat wen the searched records are displayed on the form1.vb, cliking on the navigation buttons lyk first, next etc. displays the original complete database records, nd not the searched records. The only solution obtained till now is using 2 datasets, wich i want to avoid
problem2: on wat event of form1 or search.vb should i code the query for searching?
i'll be happy to expand on the problem in case this seems insufficient.
|
|
|
|
|
Try to clear the dataset and load the new searched records and after your work completed load all the records.
3. user enters search criteria on search.vb and cliks on the "find" button.
Your task itself has answer for the problem2:
Include the search code in the button(find) click event of search.vb
Hope i answered the question
Ahamed Azeem
software Programmer
|
|
|
|