Click here to Skip to main content
15,914,010 members
Home / Discussions / C#
   

C#

 
GeneralWriting hex values to a file Pin
cgcrute9-Oct-04 6:50
cgcrute9-Oct-04 6:50 
GeneralRe: Writing hex values to a file Pin
Heath Stewart9-Oct-04 8:01
protectorHeath Stewart9-Oct-04 8:01 
GeneralRe: Writing hex values to a file Pin
cgcrute10-Oct-04 7:46
cgcrute10-Oct-04 7:46 
GeneralRe: Writing hex values to a file Pin
Heath Stewart10-Oct-04 11:05
protectorHeath Stewart10-Oct-04 11:05 
GeneralAdd dropdownlist to datalist Pin
macsgirl9-Oct-04 6:14
macsgirl9-Oct-04 6:14 
GeneralRe: Add dropdownlist to datalist Pin
Heath Stewart9-Oct-04 7:50
protectorHeath Stewart9-Oct-04 7:50 
GeneralRe: Add dropdownlist to datalist Pin
macsgirl9-Oct-04 8:04
macsgirl9-Oct-04 8:04 
GeneralRe: Add dropdownlist to datalist Pin
Heath Stewart9-Oct-04 11:43
protectorHeath Stewart9-Oct-04 11:43 
Wait, so you want a ComboBox embedded in a DataGrid? You really need to explain yourself a little better and use actual class names, since "dropdownlist" isn't a control, nor is "grid". I can only assume you mean a ComboBox and a DataGrid.

Search for "ComboBox" and "DataGrid" in a search engine. Several people have written such DataGridColumnStyle-derivatives.

If you want to "link" (again, please use technical terms, like "relate" as in "relational data") two DataGrids together, you have to establish a DataRelation between two DataTables in the same DataSet. The easiest way to do this is to create a typed DataSet in Visual Studio. You can do this by right-clicking on your project (or project folder), select Add -> Add New Item and select DataSet. Add two elements and some fields that match your tables. Using the designer right-click and add a new relation between a child and parent key. You can also do this programmatically using a non-typed DataSet by adding DataTables, then DataColumns to each table, then a DataRelation (which includes an example in the .NET Framework SDK documentation) between your DataColumns from the two different tables.

To fill this DataSet, make sure that you use DataAdapter.Fill(DataSet) and add DataAdapter.TableMappingss for the result set names and your actual tables names (since the result set names are, by default, "Table", "Table1", "Table2", etc.).

Finally, for each DataGrid for which you want to relate the data, set the DataMember property of the parent relationship to the table name of the parent table (as string). For the second, child DataGrid, set the DataMember to the "parenttable.relationship" name.

Finally, assign the DataSet as the DataSource for both. Now when you select a row in the parent DataGrid, the related records in the child DataGrid are displayed.

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]
GeneralNDoc 1.2 Problems Pin
Kevin McFarlane9-Oct-04 5:12
Kevin McFarlane9-Oct-04 5:12 
GeneralRe: NDoc 1.2 Problems Pin
Colin Angus Mackay9-Oct-04 5:49
Colin Angus Mackay9-Oct-04 5:49 
GeneralRe: NDoc 1.2 Problems Pin
Kevin McFarlane9-Oct-04 6:43
Kevin McFarlane9-Oct-04 6:43 
GeneralRe: NDoc 1.2 Problems Pin
Heath Stewart9-Oct-04 7:41
protectorHeath Stewart9-Oct-04 7:41 
Generalhide form from close button Pin
Mridang Agarwalla9-Oct-04 3:40
Mridang Agarwalla9-Oct-04 3:40 
GeneralRe: hide form from close button Pin
Colin Angus Mackay9-Oct-04 3:56
Colin Angus Mackay9-Oct-04 3:56 
GeneralRe: hide form from close button Pin
Colin Angus Mackay16-Oct-04 6:11
Colin Angus Mackay16-Oct-04 6:11 
GeneralRe: hide form from close button Pin
Anonymous17-Oct-04 0:13
Anonymous17-Oct-04 0:13 
GeneralRe: hide form from close button Pin
Colin Angus Mackay17-Oct-04 1:20
Colin Angus Mackay17-Oct-04 1:20 
Generalwav managing Pin
jeroni_brunet9-Oct-04 3:32
jeroni_brunet9-Oct-04 3:32 
GeneralRe: wav managing Pin
Colin Angus Mackay9-Oct-04 4:07
Colin Angus Mackay9-Oct-04 4:07 
GeneralRe: wav managing Pin
jeroni_brunet9-Oct-04 9:28
jeroni_brunet9-Oct-04 9:28 
GeneralRe: wav managing Pin
Colin Angus Mackay9-Oct-04 9:39
Colin Angus Mackay9-Oct-04 9:39 
GeneralRe: wav managing Pin
jeroni_brunet9-Oct-04 12:09
jeroni_brunet9-Oct-04 12:09 
GeneralRe: wav managing Pin
Colin Angus Mackay9-Oct-04 13:48
Colin Angus Mackay9-Oct-04 13:48 
GeneralRe: wav managing Pin
jeroni_brunet10-Oct-04 12:54
jeroni_brunet10-Oct-04 12:54 
Generalhttps authentification Pin
Member 14156909-Oct-04 1:43
Member 14156909-Oct-04 1:43 

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.