Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can I interpret this? Pin
Alex Cutovoi31-Aug-05 2:32
Alex Cutovoi31-Aug-05 2:32 
QuestionHow to use EMAB in n-tier Application Pin
Danech31-Aug-05 1:45
Danech31-Aug-05 1:45 
QuestionHow can i build own graphic chart control? Pin
parvinder sehrawat31-Aug-05 1:31
parvinder sehrawat31-Aug-05 1:31 
AnswerRe: How can i build own graphic chart control? Pin
enjoycrack31-Aug-05 2:10
enjoycrack31-Aug-05 2:10 
QuestionMs Word Addin Uninstall Pin
parviz_rashidi31-Aug-05 1:26
parviz_rashidi31-Aug-05 1:26 
AnswerRe: Ms Word Addin Uninstall Pin
rakesh_nits31-Aug-05 2:24
rakesh_nits31-Aug-05 2:24 
GeneralRe: Ms Word Addin Uninstall Pin
Anonymous31-Aug-05 6:23
Anonymous31-Aug-05 6:23 
QuestionDataView and DataGridTableStyle Pin
pokabot31-Aug-05 1:06
pokabot31-Aug-05 1:06 
Hi im using a data view to populate my datagrid but am unable to use DataGridTableStyle. When populating my datagrid directly with a DataTable I set the DataGridTableStyle.MappingName to my DataTable name and am able to change the look of the table and columns without any trouble. When using the dataview i get no errors just a blank datagrid. Is it not possible to use the two together?
Here is the code anyway, if someone could spot my mistakes it would be great!

**Working Code**
DataSet ds = new DataSet();
ds.ReadXml("xml.xml");

DataGrid dg = new DataGrid();
dg.DataSource = ds;
dg.DataMember = "Players";

DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = "Players";
dgts.RowHeadersVisible = false;
dgts.PreferredRowHeight = 24;
dg.TableStyles.Add(dgts);

**Broken Code**
DataSet ds = new DataSet();
ds.ReadXml("xml.xml");

DataView dv = new DataView(ds.Tables["Player"]);

DataGrid dg = new DataGrid();
dg.DataSource = dv;
//dg.DataMember = "Players"; **this line causes error**

DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = "Players";
dgts.RowHeadersVisible = false;
dgts.PreferredRowHeight = 24;
dg.TableStyles.Add(dgts);

the broken code causes no errors just displays an empty grid (if i comment out the DataGridTableStyle code the grid dispalys just fine)

Thanks in advance!!
QuestionAbout Microsoft Application center Pin
Md Saleem Navalur30-Aug-05 21:38
Md Saleem Navalur30-Aug-05 21:38 
QuestionProgram add fields into rows and editting Pin
Malpass 2k430-Aug-05 21:16
Malpass 2k430-Aug-05 21:16 
QuestionFile Transfer to palmtop via serial? Pin
Malpass 2k430-Aug-05 21:06
Malpass 2k430-Aug-05 21:06 
QuestionOpening for Tech lead in C#, WIN forms Pin
Anonymous30-Aug-05 21:00
Anonymous30-Aug-05 21:00 
AnswerRe: Opening for Tech lead in C#, WIN forms Pin
Luis Alonso Ramos31-Aug-05 1:41
Luis Alonso Ramos31-Aug-05 1:41 
QuestionMultimedia Pin
Anonymous30-Aug-05 20:50
Anonymous30-Aug-05 20:50 
AnswerRe: Multimedia Pin
Andrew Kirillov30-Aug-05 23:05
Andrew Kirillov30-Aug-05 23:05 
AnswerRe: Multimedia Pin
Lars Niedziolka31-Aug-05 14:38
Lars Niedziolka31-Aug-05 14:38 
QuestionNeed a help for image processing Pin
msmkumar30-Aug-05 20:30
msmkumar30-Aug-05 20:30 
AnswerRe: Need a help for image processing Pin
Andrew Kirillov30-Aug-05 23:17
Andrew Kirillov30-Aug-05 23:17 
GeneralPeople are strange Pin
Andrew Kirillov31-Aug-05 2:45
Andrew Kirillov31-Aug-05 2:45 
GeneralRe: People are strange Pin
msmkumar31-Aug-05 3:03
msmkumar31-Aug-05 3:03 
GeneralRe: Need a help for image processing Pin
msmkumar31-Aug-05 3:00
msmkumar31-Aug-05 3:00 
GeneralRe: Need a help for image processing Pin
Andrew Kirillov31-Aug-05 3:07
Andrew Kirillov31-Aug-05 3:07 
GeneralRe: Need a help for image processing Pin
msmkumar31-Aug-05 3:32
msmkumar31-Aug-05 3:32 
GeneralRe: Need a help for image processing Pin
Andrew Kirillov31-Aug-05 3:37
Andrew Kirillov31-Aug-05 3:37 
GeneralRe: Need a help for image processing Pin
Andrew Kirillov31-Aug-05 3:29
Andrew Kirillov31-Aug-05 3:29 

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.