Click here to Skip to main content
16,013,465 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automatic printing to pdf Pin
sverre.andersen4-Nov-04 0:06
sverre.andersen4-Nov-04 0:06 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart4-Nov-04 4:55
protectorHeath Stewart4-Nov-04 4:55 
GeneralComboboxes with relations in a datagrid Pin
jalla7214-Oct-04 0:44
jalla7214-Oct-04 0:44 
GeneralRe: Comboboxes with relations in a datagrid Pin
Heath Stewart14-Oct-04 6:46
protectorHeath Stewart14-Oct-04 6:46 
GeneralRe: Comboboxes with relations in a datagrid Pin
jalla7214-Oct-04 20:04
jalla7214-Oct-04 20:04 
GeneralRe: Comboboxes with relations in a datagrid Pin
Heath Stewart14-Oct-04 20:14
protectorHeath Stewart14-Oct-04 20:14 
GeneralRe: Comboboxes with relations in a datagrid Pin
jalla7215-Oct-04 0:01
jalla7215-Oct-04 0:01 
GeneralRe: Comboboxes with relations in a datagrid Pin
Heath Stewart15-Oct-04 6:18
protectorHeath Stewart15-Oct-04 6:18 
When relating DataGrids you always set the DataSource to the DataSet (personally, I never set this to a DataTable). For the master DataGrid, set DataMember to the appropriate table name. For the others, set DataMember to the string MasterTableName.RelationName.

Is that what you were asking about? Sorry, I just didn't quite understand:
I have tried the relation with three ComboBoxes in a windows form, and it works fine, but I get errors when I try to the same in a DataGrid, I get messages like this: UHR.Beskrivelse is not a column in table undergruppe and neither a relation.
To do this with the ComboBoxes, I'm not exactly sure how you'd do it. ListControl (from which ComboBox derives) exposes no DataMember (or similarily implemented property). This is used by the BindingContext to get the appropriate CurrencyManager for the control.

I suppose that's one thing you could do, though, although I'm sure it would get very messy in a case like this. You've obviously already created your own DataGridColumnStyle so you have a little more freedom to do what you need (doesn't mean it'll be easy, and off the top of my head I'm not sure how you'd accomplish what you want).you could implement a DataMember (you'll need to extend ComboBox, too) and manipulate the CurrencyManager yourself. This is where diassemblers like ildasm.exe or decompilers/disassemblers like .NET Reflector com in handy - so you can see how Microsoft implements and, hopefully, can override key behavior without the use of reflection (which introduces more constraints on your application/library depending on its evidence (CAS)).

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
QuestionHow to make the Form (at run time) behave like the Form (at design time) Pin
god4k14-Oct-04 0:33
god4k14-Oct-04 0:33 
AnswerRe: How to make the Form (at run time) behave like the Form (at design time) Pin
Heath Stewart14-Oct-04 6:50
protectorHeath Stewart14-Oct-04 6:50 
AnswerRe: How to make the Form (at run time) behave like the Form (at design time) Pin
Christian Wikander15-Oct-04 3:32
Christian Wikander15-Oct-04 3:32 
GeneralMoving a file over a network. Pin
Dylan van Heerden14-Oct-04 0:30
Dylan van Heerden14-Oct-04 0:30 
GeneralRe: Moving a file over a network. Pin
Colin Angus Mackay14-Oct-04 2:00
Colin Angus Mackay14-Oct-04 2:00 
GeneralRe: Moving a file over a network. Pin
Dylan van Heerden14-Oct-04 2:18
Dylan van Heerden14-Oct-04 2:18 
GeneralRe: Moving a file over a network. Pin
Colin Angus Mackay14-Oct-04 2:22
Colin Angus Mackay14-Oct-04 2:22 
GeneralRe: Moving a file over a network. Pin
Dylan van Heerden14-Oct-04 2:39
Dylan van Heerden14-Oct-04 2:39 
GeneralRe: Moving a file over a network. Pin
Colin Angus Mackay14-Oct-04 2:47
Colin Angus Mackay14-Oct-04 2:47 
GeneralRe: Moving a file over a network. Pin
Dylan van Heerden14-Oct-04 2:51
Dylan van Heerden14-Oct-04 2:51 
GeneralRe: Moving a file over a network. Pin
Heath Stewart14-Oct-04 6:43
protectorHeath Stewart14-Oct-04 6:43 
GeneralRe: Moving a file over a network. Pin
Heath Stewart14-Oct-04 6:38
protectorHeath Stewart14-Oct-04 6:38 
GeneralStrong name to Interop assembly Pin
hatim_ali13-Oct-04 23:44
hatim_ali13-Oct-04 23:44 
GeneralRe: Strong name to Interop assembly Pin
Alex Korchemniy14-Oct-04 9:18
Alex Korchemniy14-Oct-04 9:18 
GeneralRe: Strong name to Interop assembly Pin
hatim_ali14-Oct-04 19:19
hatim_ali14-Oct-04 19:19 
GeneralInsert RTF files in Access DB Pin
Zamolxes13-Oct-04 23:35
Zamolxes13-Oct-04 23:35 
GeneralRe: Insert RTF files in Access DB Pin
Judah Gabriel Himango14-Oct-04 5:45
sponsorJudah Gabriel Himango14-Oct-04 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.