C# Messy Function - Refactoring
I would consider inverting the first if to make it simpler and quicker to be aware of the else.



I strongly suggest always leaving something inside a catch - if you have nothing else to put there at least leave a comment.



I would change

if (Bankkonto1.Rows.Count &gt; 0)


to, using System.Linq; :

if (Bankkonto1.Rows.Any())




I would save reused values in scoped variables:

string objValue = obj.ToString();
...
int selectedRow = Bankkonto1.SelectedRow.Index;




I would consider refactoring the foreach

        foreach (UltraGridRow myRow in Bankkonto1.Rows)
        {
            if (myRow.Cells[STR_Id].Text != obj.ToString()) 
                continue;


into a Linq select:

        var row = Bankkonto1.Rows.FirstOrdefault( r =&gt; r.Cells[STR_Id].Text == objValue);
        if(row != null) {