TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
484
2.9k
196.8k
Error in my app...index column negativecsome help?
Mar 18 2019 11:20 AM
Error is here line 11 and line 12
row = (DataGridViewRow)roba_uslugeDataGridView.SelectedRows[i].Clone(); int intColIndex =
0
;
Some help?
Private
void
roba_uslugeDataGridView_CellDoubleClick(
object
sender, DataGridViewCellEventArgs e)
{
DataGridViewRow row =
new
DataGridViewRow();
for
(
int
i = 0; i < roba_uslugeDataGridView.Rows.Count; i++)
{
row = (DataGridViewRow)roba_uslugeDataGridView.SelectedRows[i].Clone();
int
intColIndex = 0;
foreach
(DataGridViewCell cell
in
roba_uslugeDataGridView.SelectedRows[i].Cells)
{
var ColIndex = dataGridView1.Rows.Add();
dataGridView1.Rows[intColIndex].Cells[
"redni_broj"
].Value = intColIndex + 1;
dataGridView1.Rows[intColIndex].Cells[
"bar_kod"
].Value = cell.Value.ToString();
dataGridView1.Rows[intColIndex].Cells[
"sifra"
].Value = cell.Value;
dataGridView1.Rows[intColIndex].Cells[
"naziv_artikla"
].Value = cell.Value;
dataGridView1.Rows[intColIndex].Cells[
"cijena"
].Value = cell.Value;
dataGridView1.Rows[intColIndex].Cells[
"kolicina"
].Value =
"1"
;
foreach
(DataGridViewRow g1
in
dataGridView1.Rows)
{
g1.Cells[
"ukupno"
].Value = (Convert.ToDouble(g1.Cells[
"kolicina"
].Value) * Convert.ToDouble(g1.Cells[
"cijena"
].Value)).ToString(
"0.00"
);
}
row.Cells[intColIndex].Value = cell.Value;
intColIndex++;
}
dataGridView1.Rows.Add(row);
}
dataGridView1.AllowUserToAddRows =
false
;
dataGridView1.Refresh();
}
Reply
Answers (
1
)
find User Control controls on Page in asp.net
what is Liskov substitution principle with Example?