|
Hi,
I am going to edit and update record in datagrid , every time I am able to edit or update one record and again I m going to click button of grid view getting this error “Cannot set the SelectedValue in a ListControl with an empty ValueMember.” .. then again close to application and able to do edit and update any one record…
Vinay
|
|
|
|
|
Your explanation made absolutely no sense what-so-ever.
|
|
|
|
|
Hi Vinay,
With this minimum explanation, it seems that you are using data binding. Also, you have some ListControl in your form as well which is related to the same datasource (i.e. same datatable might be used for Grid and that control). This list control does not have blank value in its master data.
Verify this one otherwise try to debug (setting break points whereever ValueMember is set) your code to find out where you are getting the error.
|
|
|
|
|
I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..
Vinay
|
|
|
|
|
Use different datasource for each combobox, even if the data are the same.
|
|
|
|
|
|
So are you saying that each combo should point to a different copy of the save data? Isn't that a little inefficient??
|
|
|
|
|
All you need to do is create two BindingSource objects and put them between the Combo's and the data. Each Combo will have its DataSource property set to one of the BindingSource objects. Then each BindingSource will have it's DataSource property point to the same data object. Something like this:
ComboBox1.DataSource ------> BindingSource1 -----\
\
+----> Data
/
ComboBox2.DataSource ------> BindingSource2 -----/
|
|
|
|
|
See that's why I skulk around here, I have used the table.copy method to achieve this in the past as I have never used a bindingsource as a datasource for a combo.
Thanks Dave
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Glad it'll help you. It's just a little something I found in someone elses brain droppings.
|
|
|
|
|
Dave Kreskowiak wrote: It's just a little something I found in someone elses brain droppings
Yikes. The things you poke in.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I want to handle Edit and update both from one Button control in Winform2008, let me know , how can I do this….
Vinay
|
|
|
|
|
Set/check the text of the button in the onclick event.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Not enough information to answer your question. The biggest problem with this design is how is the button click handler going to know the difference in the users intent when the button is clicked??
|
|
|
|
|
Keep a Form level variable to get the mode of the screen.
private String mode = "Edit";
Now change this mode whenever, your form's mode is being changed.
Based on this private varible you can decide the text of the button.
btnSave.Text = (mode == "Edit")?"Edit" : "Update";
Hope this yould help you.
Regards,
Arindam Sinha
|
|
|
|
|
This question is as old as the dawn of windows itself, but this time round with more parameters added. I know all about SDI and MDI development, but I want to rest a case of which is best in terms of processing power. I have used both in my developing career and fully understand the pains and gains of each except:
In terms of .NET 2+ and C#:
Which is best in terms of performance: a MDI with a menu bar and two child forms - no matter the content - or two SDI's with the same menu bar and corresponding content. Forget the effeort to link the forms and carra data over from the one to the other - performance only, processing power, memory usage/footprint, JIT, GC etc.
The real reason for this is I need to have some expert advice to shut some mouths shooting off in only one direction. If you can point me, give expert advice, direction or whatever to state a case I'll appreciate it dearly.
|
|
|
|
|
In my opinion since MDI would require three forms (one father and two childs), the memory footprint will sure be slightly larger.
The same goes for computing power, since there will be three forms, all with their message management and so on.
But I doubt this will have any serious impact on the application, unless you are counting bytes or CPU cycles. And if you are doing that, you're better off using C++ or some other lower level language.
I think the real question is: how would you implement your solution with MDI and with SDI, and which would be the most performing / better ? You may discover that the changes in the implementation carry some benefit for one or the other. So the choice would depend on that, not on religion wars between SDI and MDI.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
I have similar thoughts - no wars. Figure out what you want to use and use the appropriate method - 6 of the one and half a dozen of the other in terms of usability and performance. The other option is WPF, but in my case it will not work properly in a Terminal Services / Citrix environment - bandwidth too expensive...
"the confused are confused beyond confusion" - Pik Botha (1990)
|
|
|
|
|
Already you got couple of answers. I would like give you another link - Composite UI Application Block[^].
Using this, you can concentrate on application development and leaving the rest of the things on Microsoft's Patterns and Practices team.
Let me know if this helps or if you need any details on CAB/SCSF[^].
Regards,
Arindam Sinha
|
|
|
|
|
Using VB.net...
I've built a utility that grabs the frames from a multi-frame .tif or gif so I can save them to individual files. In one file (a tif fax document) the dimensions are reversed - 11 x 8.5 instead of 8.5 by 11. Text orientation is correct, but not the dimensions.
I assume the problem is on my end because when I open the file in Irfanview it displays correctly. None of the other TIFs I'm testing with are fax documents, and they display correctly. Worth noting that both Paint.net and MS Paint have the same problem I'm having.
Anyone have an idea as to the root of the problem?
|
|
|
|
|
Hi,
I checked the TIFF specification[^] and it seems (page 36) TIFF has an Orientation field with 8 possible values; only "1" is supported in baseline TIFF, the others are extensions. So I would guess your specific TIFF file uses an extended value, your utilities support the extension and your app does not.
If this is a one of, maybe it's best to just use a utility to convert to baseline TIFF. Otherwise fix your code (that is assuming GDI+ knows about the orientation extensions, I can't tell right now).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks much. Will dig deeper into the tiff specs and see if I can get at the field.
|
|
|
|
|
Hi,
Is it possible to find out file location using C language in Windows programming?Is there any function in C language which can display the file location?
|
|
|
|
|
No, there isn't. You'll either have to write code to use Windows Search[^] or to search the drive yourself, recursing through the filesystem until you find the file you want.
|
|
|
|
|
hi Dave Kreskowiak,thanks for suggestion.
|
|
|
|