-
March 22nd, 2023, 08:32 PM
#1
Why can't I add a record to Devexpress's gridView ?
I have the following code, when I run it, I can't add a new line to the gridView, thanks for your help:
Code:
...
for (int i = 0; i < dt.Rows.Count; i++)
{
try
{
// Add into gridView
gridView1.AddNewRow();
// Set rowHandle
int rowHandle = gridView1.GetRowHandle(gridView1.DataRowCount);
if (gridView1.IsNewItemRow(rowHandle))
{
gridView1.SetRowCellValue(rowHandle, gridView1.Columns["ID"], i);
gridView1.SetRowCellValue(rowHandle, gridView1.Columns["Name"], "Peter");
gridView1.SetRowCellValue(rowHandle, gridView1.Columns["Age"], 35);
// Update gridView
gridView1.UpdateCurrentRow();
}
else
{
Debug.Print("Not row new!");
}
}
catch (Exception ex)
{
Debug.Print("Exception ex: " + ex);
}
}
...
-
March 23rd, 2023, 04:22 AM
#2
Re: Why can't I add a record to Devexpress's gridView ?
Originally Posted by dongtrien
I have the following code, when I run it, I can't add a new line to the gridView ...
And what happens?
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|