datatype in DataGridview
-
how to divided cell in Datagrid view. My code is don't work in fraction number. Someone advise me. Thanks you all.
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
int R1 = row.Index;
for (b = 0; b < dataGridView2.ColumnCount; b++)
{
a = 0;
for (c = 0; c < dataGridView2.RowCount; c++)
{
Ans_Grid.Rows[R1].Cells[b].Value =
(((Double.Parse(dataGridView1.Rows[R1].Cells[c].Value.ToString()))
* (Double.Parse(dataGridView2.Rows[c].Cells[b].Value.ToString())))).ToString()
;
Ans_Grid.Rows[R1].Cells[b].Value = a + Convert.ToInt16(Ans_Grid.Rows[R1].Cells[b].Value);
a = Convert.ToDouble(Ans_Grid.Rows[R1].Cells[b].Value); -
how to divided cell in Datagrid view. My code is don't work in fraction number. Someone advise me. Thanks you all.
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
int R1 = row.Index;
for (b = 0; b < dataGridView2.ColumnCount; b++)
{
a = 0;
for (c = 0; c < dataGridView2.RowCount; c++)
{
Ans_Grid.Rows[R1].Cells[b].Value =
(((Double.Parse(dataGridView1.Rows[R1].Cells[c].Value.ToString()))
* (Double.Parse(dataGridView2.Rows[c].Cells[b].Value.ToString())))).ToString()
;
Ans_Grid.Rows[R1].Cells[b].Value = a + Convert.ToInt16(Ans_Grid.Rows[R1].Cells[b].Value);
a = Convert.ToDouble(Ans_Grid.Rows[R1].Cells[b].Value);