Hi.
I take the table on a web page with C # and Selenium and show it in radGridView.
I add a GridViewCheckBoxColumn before the first column of each row, and I add GridViewDateTimeColumn and GridViewComboBoxColumn after the last column.
I want to equalize the initial value of the DatePicker object in GridViewDateTimeColumn to the value in column 7 of the row where it is located.
However, the initial value of DatePickers in all rows is equal to the value in the 7th column of the last row.
Here is my code:
01.
public
void
FillRadGridView(List<IWebElement> rows, List<IWebElement> columns,
int
rowCount,
int
columnCount, RadGridView rgv)
02.
{
03.
04.
List<Visit> lst =
new
List<Visit>();
05.
Visit v =
new
Visit();
06.
for
(
int
i = 0; i < rowCount; i++)
07.
{
08.
for
(
int
j = 1; j <= columnCount; j++)
09.
{
10.
11.
v.Tckn = columns[1].Text;
12.
v.AdSoyad = columns[2].Text;
13.
v.Vaka = columns[3].Text;
14.
v.RaporTakipNo = columns[4].Text;
15.
v.RaporSiraNo = columns[5].Text;
16.
v.RaporBaslamaTarihi = DateTime.Parse(columns[6].Text).ToShortDateString();
17.
v.RaporBitisTarihi = DateTime.Parse(columns[7].Text).AddDays(-1).ToShortDateString();
18.
v.IsBasiKontrolTarihi = DateTime.Parse(columns[7].Text).ToShortDateString();
19.
v.CezaDurumu = columns[8].Text;
20.
21.
}
22.
lst.Add(v);
23.
}
24.
rgv.Columns.Clear();
25.
26.
GridViewCheckBoxColumn checkBoxColumn =
new
GridViewCheckBoxColumn();
27.
checkBoxColumn.DataType =
typeof
(
int
);
28.
checkBoxColumn.Name =
"ColumnSelect"
;
29.
checkBoxColumn.FieldName =
"select"
;
30.
checkBoxColumn.HeaderText =
"Seç"
;
31.
rgv.Columns.Add(checkBoxColumn);
32.
33.
rgv.DataSource = lst;
34.
AddColumnToRgv(rgv);
35.
36.
}