Hello!
I am using a gridview like this:
How can i get the informations for the current row, the row i have selected?
Thank you!
I am using a gridview like this:
private
void
LoadGrid()
{
DataTable dataTable =
new
DataTable();
DataColumn itemIdColumn =
new
DataColumn(
"ItemId"
,
typeof
(
int
));
DataColumn itemCodeColumn =
new
DataColumn(
"ItemCode"
,
typeof
(
string
));
DataColumn itemNameColumn =
new
DataColumn(
"ItemName"
,
typeof
(
string
));
DataColumn sellPriceColumn =
new
DataColumn(
"SellPrice"
,
typeof
(
decimal
));
DataColumn vatValueColumn =
new
DataColumn(
"VatValue"
,
typeof
(
decimal
));
DataColumn itemTypeColumn =
new
DataColumn(
"ItemType"
,
typeof
(
int
));
dataTable.Columns.Add(itemCodeColumn);
dataTable.Columns.Add(itemNameColumn);
dataTable.Columns.Add(sellPriceColumn);
dataTable.Columns.Add(vatValueColumn);
dataTable.Columns.Add(itemTypeColumn);
dataTable.Columns.Add(itemIdColumn);
dataTable.BeginLoadData();
var lst = _relatedItemBc.GetItemsForMainGrid(FilteredItem);
for
(
int
i = 0; i < lst.Count; i++)
{
DataRow row = dataTable.NewRow();
row[
"ItemCode"
] = lst[i].ItemCode;
row[
"ItemName"
] = lst[i].ItemName;
row[
"SellPrice"
] = lst[i].SellPrice;
row[
"VatValue"
] = lst[i].VATValue;
row[
"ItemType"
] = lst[i].ItemType;
row[
"ItemId"
] = lst[i].ItemID;
dataTable.Rows.Add(row);
}
dataTable.EndLoadData();
rbcDataGridViewMain.MasterTemplate.BeginUpdate();
rbcDataGridViewMain.DataSource = dataTable;
rbcDataGridViewMain.MasterTemplate.EndUpdate();
}
How can i get the informations for the current row, the row i have selected?
Thank you!