Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
QuestionLocking a form when another form is opened??? Pin
shw 23413-Dec-08 21:58
shw 23413-Dec-08 21:58 
AnswerRe: Locking a form when another form is opened??? Pin
ahmed eldeghedy13-Dec-08 22:15
professionalahmed eldeghedy13-Dec-08 22:15 
AnswerRe: Locking a form when another form is opened??? Pin
jas0n2313-Dec-08 22:25
jas0n2313-Dec-08 22:25 
Questionautocomplete in datagraid Pin
ahmed eldeghedy13-Dec-08 21:35
professionalahmed eldeghedy13-Dec-08 21:35 
AnswerRe: autocomplete in datagraid Pin
Christian Graus13-Dec-08 22:26
protectorChristian Graus13-Dec-08 22:26 
QuestionToolStripMenuItem Object Pin
Zeyad Jalil13-Dec-08 20:21
professionalZeyad Jalil13-Dec-08 20:21 
AnswerRe: ToolStripMenuItem Object Pin
Lev Danielyan13-Dec-08 20:26
Lev Danielyan13-Dec-08 20:26 
Questionshow string Property of a custom class in DGV Pin
Xmen Real 13-Dec-08 16:41
professional Xmen Real 13-Dec-08 16:41 
i'm trying to do as the title says...
im using a DataTable and add DataRow[] in it and every DR contains a column type of a class i have made. The class have 2 properties, a string and an int. Then i bind that DataTable to DataGridView. Now problem is that its showing the class name with Namespace and it should. But i want it to show that string property in that column.

Its exactly same like ComboBox or ListBox binding.

I tried with DataPropertyName but all columns appear blank

dataGridView.Columns[0].DataPropertyName = "Name";



full code

DataTable tmp_dt = new DataTable();
tmp_dt.Columns.Add("Info", typeof(XYZclass));

DataRow tmp_dr = tmp_dt.NewRow();
tmp_dr["Info"] = new XYZclass("a string Param to set the string in class");
tmp_dt.Rows.Add(tmp_dr);
dataGridView.DataSource = tmp_dt;
dataGridView.Columns[0].DataPropertyName = "Name";

any idea ?

TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can

AnswerRe: show string Property of a custom class in DGV Pin
Tony Pottier13-Dec-08 17:24
Tony Pottier13-Dec-08 17:24 
GeneralRe: show string Property of a custom class in DGV Pin
Xmen Real 13-Dec-08 19:30
professional Xmen Real 13-Dec-08 19:30 
GeneralRe: show string Property of a custom class in DGV [modified] Pin
Xmen Real 13-Dec-08 19:52
professional Xmen Real 13-Dec-08 19:52 
QuestionAvoid #Error Label on reportviewer while getting null value Pin
vbexpert113-Dec-08 9:13
vbexpert113-Dec-08 9:13 
AnswerRe: Avoid #Error Label on reportviewer while getting null value Pin
Christian Graus13-Dec-08 11:05
protectorChristian Graus13-Dec-08 11:05 
AnswerRe: Avoid #Error Label on reportviewer while getting null value Pin
Mycroft Holmes13-Dec-08 20:22
professionalMycroft Holmes13-Dec-08 20:22 
GeneralRe: Avoid #Error Label on reportviewer while getting null value Pin
vbexpert113-Dec-08 20:35
vbexpert113-Dec-08 20:35 
GeneralRe: Avoid #Error Label on reportviewer while getting null value Pin
Mycroft Holmes13-Dec-08 20:55
professionalMycroft Holmes13-Dec-08 20:55 
GeneralRe: Avoid #Error Label on reportviewer while getting null value Pin
vbexpert113-Dec-08 22:05
vbexpert113-Dec-08 22:05 
QuestionxUnit 1.1 Pin
Jammer13-Dec-08 8:51
Jammer13-Dec-08 8:51 
AnswerRe: xUnit 1.1 Pin
Pete O'Hanlon14-Dec-08 10:32
mvePete O'Hanlon14-Dec-08 10:32 
QuestionNeed to 'hire' a programmer for a very small program. 75 % complete already Pin
Nomadico13-Dec-08 7:34
Nomadico13-Dec-08 7:34 
AnswerRe: Need to 'hire' a programmer for a very small program. 75 % complete already Pin
Expert Coming13-Dec-08 7:58
Expert Coming13-Dec-08 7:58 
AnswerRe: Need to 'hire' a programmer for a very small program. 75 % complete already Pin
Christian Graus13-Dec-08 10:18
protectorChristian Graus13-Dec-08 10:18 
AnswerRe: Need to 'hire' a programmer for a very small program. 75 % complete already Pin
Colin Angus Mackay13-Dec-08 11:10
Colin Angus Mackay13-Dec-08 11:10 
GeneralRe: Need to 'hire' a programmer for a very small program. 75 % complete already Pin
Christian Graus13-Dec-08 11:37
protectorChristian Graus13-Dec-08 11:37 
GeneralRe: Need to 'hire' a programmer for a very small program. 75 % complete already Pin
Guffa13-Dec-08 16:01
Guffa13-Dec-08 16:01 

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.