Hallo,
It is my first post so Hallo!
I have a problem with radgridview.
Here is my sample code:
Now I want to select the cell where I made the changes.
Everything works fine, but after I use the scrol color changes position and jumps to a random record or cell.
What am I doing wrong?
It is my first post so Hallo!
I have a problem with radgridview.
Here is my sample code:
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) { if (e.CellElement.RowInfo.Cells["io_time_sec"].Value != null) { Int64 lTime = Convert.ToInt64(e.CellElement.RowInfo.Cells["io_time_sec"].Value); Int16 nStat = Convert.ToInt16(e.CellElement.RowInfo.Cells["io_state"].Value); if ((lTime <= 0) || (lTime >= 36000)) { e.CellElement.DrawText = true; e.CellElement.ForeColor = Color.Red; e.CellElement.NumberOfColors = 1; e.CellElement.GradientStyle = GradientStyles.Solid; } else { e.CellElement.DrawText = true; e.CellElement.ForeColor = Color.Black; e.CellElement.NumberOfColors = 1; e.CellElement.GradientStyle = GradientStyles.Solid; } }}Now I want to select the cell where I made the changes.
void dgvView_Changed(object sender, CorrectDateTimeEvents e) { if (e.en == CorrectDataEventsEnum.Evt_Cancel) { winform.Close(); } if (e.en == CorrectDataEventsEnum.Evt_OK) { radGridView1.CurrentRow.Cells["io_datein"].Value = e.valueDateIn; radGridView1.CurrentRow.Cells["io_dateout"].Value = e.valueDateOut; radGridView1.CurrentCell.DrawFill = true; radGridView1.CurrentCell.BackColor = Color.BlueViolet; radGridView1.CurrentCell.NumberOfColors = 1; radGridView1.CurrentCell.GradientStyle = GradientStyles.Solid; winform.Close(); } }Everything works fine, but after I use the scrol color changes position and jumps to a random record or cell.
What am I doing wrong?
