Dear Team,
i tried to move the selected row (Right Grid to Left Grid) another ultra grid without using Checkbox selected event. I’m trying in button click event. Kindly help on this.
Dear Team,
i tried to move the selected row (Right Grid to Left Grid) another ultra grid without using Checkbox selected event. I’m trying in button click event. Kindly help on this.
This would not match Epicor UI standards, but maybe this page will give some ideas:
https://knowledgebase.progress.com/articles/Article/P170096
Sorry no ideas, just curious… can you expand on how you’d use this, data that is being moved?
Interesting, thanks for pointing this out.
Do you mean, select a row and then click a button to move it, or click a row and it immediately moves?
if i’m select a row then click on right move button selected records should be move to another grid.
Okay, I’ve actually done part of this…it’s not pretty. If your second grid has the same data pattern as the first grid, you can probably just add the row as-is instead of turning selected values into an array like I do.
private void btnAddSelected_Click(object sender, System.EventArgs args)
{
if( this.LeftGrid.Selected.Rows.Count > 0 ) {
string failmsg = "";
foreach( var row in this.LeftGrid.Selected.Rows )
failmsg = failmsg + AddSelectedRow(row);
if( !string.IsNullOrEmpty(failmsg) )
EpiMessageBox.Show(failmsg);
}
}
private string AddSelectedRow(UltraGridRow row)
{
string failmsg = "";
string[] newrow = new string[6];
newrow[0] = (string)row.Cells[0].Value;
newrow[1] = (string)row.Cells[1].Value;
newrow[2] = (string)row.Cells[2].Value;
newrow[3] = (string)row.Cells[3].Value;
newrow[4] = row.Cells[4].Value.ToString();
newrow[5] = row.Cells[7].Value.ToString();
try {
this.RightGrid.Rows.Add(newrow);
}
catch (ConstraintException) {
failmsg = string.Format("Row already added: {0}, {1} {2}{3}", row.Cells[0].Value, row.Cells[1].Value, row.Cells[2].Value, (char)13);
}
return failmsg;
}
Note that this doesn’t remove the original row.
ok. i’ll check let u know