BrowseDialog


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yup....Ivan is right on the money Wink
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Rafael.

I think it is going to be hard to tell you "why", without knowing how you are fetching your data. The thing is, at the point you are getting an error, your BO is empty. Have a look at your fill methods and that might give you some clues.

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
Yes but in my SqlServer have 70 registers and return of count = 0 , Why ?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
That's right....you need to test on whether there is actually a record loaded in the BO because the CurrentRow relies on the CurrentRowIndex, which is a -1 if there are no records.  So add a test on the count around your code:

if(this.Count > 0)
{
   // Place your logic here
}
else
{
   // Take the empty BO into account
}

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I have a code:

private void btnLkpCondPagamento_Click(object sender, EventArgs e)

{

if (this.bdCondicaoDePagamento.ShowDialog() == DialogResult.OK)

{

cdp_cod.Text = Convert.ToString(sysPedidoCompraCondicaoDePagamento1.cdp_cod);

cdp_descr.Text = Convert.ToString(sysPedidoCompraCondicaoDePagamento1.cdp_descr);

}

}

But have a error :  The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.

public System.Int32 cdp_cod

{

get

{

object loValue;

loValue = this.CurrentRow["cdp_cod"];

if (loValue == DBNull.Value)

{

return 0;

}

else

{

return (System.Int32)loValue;

}

}

set

{

this.CurrentRow["cdp_cod"] = value;

}

}


Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I know that to convert but if have a solution in property of textbox i will use
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I think you have to convert it using CSTR()

Edhy Rijo

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216

Campo.Text = sysFornecedorBO1.for_cod;

Campo2.Text = sysFornecedorBO1.for_nome;

Have a error:

Error 4 Cannot implicitly convert type 'int' to 'string' D:\GoLive Corporate\myForms\frmPedidoCompra.cs 207 33 GoLiveCorporate

The textbox of the MricoFur.Strataframe have a property of numbers ?


Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Olá Rafael.

Not sure about what you are asking, but I guess you want to use the BrowseDialog as a pick list, called from a buttom somewhere on you form, is that right? Once you get back from the BrowseDialog, the Business Object that was set as the BusinessObjectToPopulate on the BrowseDialog properties, will be populate, as the property name says, with the results of your search, and pointing to the selected row.

So, all you need to do is to use whatever piece of information you need from it.

Lets say you want to find a Customer, and fill the CustomerName on your Orders form. You drop a buttom on the form, and put some code in its Click event, like the following, to call your BrowseDialog and set the Text property of your Customer textbox:

        If Me.MyBrowseDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Me.txtCustomerName.Text = CustomersBO1.cus_Name
        End If

Does that help?

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
thank all Smile

i study this example, if i have a doubt, i post Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search