Objectdatasource DefaultValue property and Integer error

S

Syd_Man

Hello guys,
I have some wiered problem ...I have a header details form where the
header part is a datagrid and the details part is a Detailsview
control.

Once I select a record in the header it should show in the details
part. It works fine with strings but now i have a field which is
Integer and it complains about conversion. The bind is below:

<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
DefaultValue="EmployeeID = {0}" Name="argID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>

is this format correct? DefaultValue="EmployeeID = {0}" ?

I use the code behinde to fill the detailsview and it works fine eg

Dim emp As New Employees

Dim empId As Integer
empId = Val(GridView1.SelectedValue.ToString)

Me.DetailsView1.DataSource = emp.GetEmployeesByID(empId)
DetailsView1.DataBind()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top