Click here to Skip to main content
15,889,808 members
Home / Discussions / C#
   

C#

 
AnswerRe: Military time project Pin
Ennis Ray Lynch, Jr.27-Apr-09 8:22
Ennis Ray Lynch, Jr.27-Apr-09 8:22 
Question3D data visualization Pin
ehsan salehi27-Apr-09 6:47
ehsan salehi27-Apr-09 6:47 
GeneralRe: 3D data visualization Pin
harold aptroot27-Apr-09 7:41
harold aptroot27-Apr-09 7:41 
GeneralRe: 3D data visualization Pin
ehsan salehi27-Apr-09 19:29
ehsan salehi27-Apr-09 19:29 
GeneralRe: 3D data visualization Pin
harold aptroot28-Apr-09 2:12
harold aptroot28-Apr-09 2:12 
GeneralRe: 3D data visualization Pin
ehsan salehi29-Apr-09 1:50
ehsan salehi29-Apr-09 1:50 
GeneralRe: 3D data visualization Pin
harold aptroot4-May-09 3:46
harold aptroot4-May-09 3:46 
Questionformatting data in a datagridview Pin
bwood202027-Apr-09 6:28
bwood202027-Apr-09 6:28 
Hello,

I have created a datagridview using C# windows application and I am having formatting issues with the data once the datagridview has been populated. The way I have this set up is before I bind the data to the binding source I add a new row which contains combo boxes. These Como boxes are used to populate the new headers. Once the headers have been modified the data needs to be formatted to data types the system can handle. For example, the datagridview populates dates as mm/dd/yyyy 00.00.00 AM but I need to reformat this to mm/dd/yyyy. I have created a method that loops through each cell in the first row and captures the new header (which works) but when the code that is suppose to reformat the column runs, it doesn't work. the code I have to reformat the columns based on the logic used is dataGridView1.Columns[c].DefaultCellStyle.Format = "d";. However, this doesn't work. Can someone please help me? It is much appreciated. Here is what I have and if it is not enough then let me know and I can post more code.

private void button10_Click(object sender, EventArgs e)
{


if (radioButton1.Checked == true)

{

string[] newHeaders = new string[dataGridView1.ColumnCount];

int n = dataGridView1.ColumnCount;
int c = 0;

for (c = 0; c < n; c++)
{
newHeaders[c] = dataGridView1.Rows[0].Cells[c].Value.ToString();

if (newHeaders[c] == "A1ORDT")
{

dataGridView1.Columns[c].DefaultCellStyle.Format = "d";


}

}




}
else if (radioButton2.Checked == true)
{
//Add code for custom formatting
}
else
{
MessageBox.Show("Please select standard or custom formatting");
}

}
QuestionHow to get rid of clr20r3 error and show "Office not found" message in the application. Pin
lastpunisher27-Apr-09 5:56
lastpunisher27-Apr-09 5:56 
AnswerRe: How to get rid of clr20r3 error and show "Office not found" message in the application. Pin
Rolando CC27-Apr-09 6:03
professionalRolando CC27-Apr-09 6:03 
GeneralRe: How to get rid of clr20r3 error and show "Office not found" message in the application. Pin
lastpunisher27-Apr-09 6:23
lastpunisher27-Apr-09 6:23 
AnswerRe: How to get rid of clr20r3 error and show "Office not found" message in the application. Pin
lastpunisher27-Apr-09 8:44
lastpunisher27-Apr-09 8:44 
QuestionCryptography - why can't I load the IV directly? Pin
OriginalGriff27-Apr-09 5:55
mveOriginalGriff27-Apr-09 5:55 
AnswerRe: Cryptography - why can't I load the IV directly? Pin
musefan27-Apr-09 6:01
musefan27-Apr-09 6:01 
GeneralRe: Cryptography - why can't I load the IV directly? Pin
OriginalGriff27-Apr-09 6:13
mveOriginalGriff27-Apr-09 6:13 
QuestionReturn the Stack Trace of another process. Pin
Chris Sims27-Apr-09 5:36
Chris Sims27-Apr-09 5:36 
QuestionStored Procedure Pin
kibromg27-Apr-09 5:34
kibromg27-Apr-09 5:34 
AnswerRe: Stored Procedure Pin
Le centriste27-Apr-09 5:44
Le centriste27-Apr-09 5:44 
AnswerRe: Stored Procedure Pin
Member 103390727-Apr-09 9:00
Member 103390727-Apr-09 9:00 
GeneralRe: Stored Procedure Pin
kibromg28-Apr-09 0:36
kibromg28-Apr-09 0:36 
GeneralRe: Stored Procedure Pin
Member 103390730-Apr-09 4:45
Member 103390730-Apr-09 4:45 
Questionaraye Pin
mostafatajamolian27-Apr-09 5:30
mostafatajamolian27-Apr-09 5:30 
AnswerRe: araye Pin
Nagy Vilmos27-Apr-09 5:52
professionalNagy Vilmos27-Apr-09 5:52 
JokeRe: araye Pin
OriginalGriff27-Apr-09 6:16
mveOriginalGriff27-Apr-09 6:16 
AnswerRe: araye Pin
Rolando CC27-Apr-09 5:53
professionalRolando CC27-Apr-09 5:53 

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.