By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,099 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Question on Details View

P: n/a
Hi All,

I have a question on the ASP.NET 2.0 Details view control

I dont like using the SQLDataSource to bind the data to the
DetailsView control..
I dont like the idea of placing Queries in the .ASPX files...I
prefer a 3 tiered approach to
development.

Am using a Custom object to bind the object to the Details View
control at run time..
When the page loads....like this

BO.TestBO bo = new BO.TestBO();
CustomObject object = bo.GetProfileInformation(1);

this.personalInfoDetailsView.AllowPaging = false;
this.interestInfoDetailsView.AllowPaging = false;

this.personalInfoDetailsView.DataSource = object;
this.personalInfoDetailsView.DataBind();

This is the Details view control...
<asp:DetailsView CellPadding="1" Font-Names="Verdana" Width="100%">
<Fields>
<asp:BoundField DataField="name" ReadOnly="True"
SortExpression="name" />
<asp:CheckBoxField DataField="gender"
SortExpression="gender" />
<asp:BoundField DataField="interests"
ReadOnly="True"

SortExpression="interests" />
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>

So here the custom object has three properties
name ---contains a name
gender ---boolean value
interests --This contains a comma separated string (Example:
music,movies, cycling, tennis)

So during Display mode.... the 'interests' field shows the comma
separated values.

But during edit mode, a text box appears in its place and the comma
separated values are populated for editing purpose...

Now when user goes into edit mode ....i want each value of the comma
separated string as a separate check box...so that the user can select
the options..

Is this possible?
What special code is to be written?

Jun 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jun 8, 12:23 am, kamlesh <kamles...@gmail.comwrote:
Hi All,

I have a question on the ASP.NET 2.0 Details view control

I dont like using the SQLDataSource to bind the data to the
DetailsView control..
I dont like the idea of placing Queries in the .ASPX files...I
prefer a 3 tiered approach to
development.

Am using a Custom object to bind the object to the Details View
control at run time..
When the page loads....like this

BO.TestBO bo = new BO.TestBO();
CustomObject object = bo.GetProfileInformation(1);

this.personalInfoDetailsView.AllowPaging = false;
this.interestInfoDetailsView.AllowPaging = false;

this.personalInfoDetailsView.DataSource = object;
this.personalInfoDetailsView.DataBind();

This is the Details view control...
<asp:DetailsView CellPadding="1" Font-Names="Verdana" Width="100%">
<Fields>
<asp:BoundField DataField="name" ReadOnly="True"
SortExpression="name" />
<asp:CheckBoxField DataField="gender"
SortExpression="gender" />
<asp:BoundField DataField="interests"
ReadOnly="True"

SortExpression="interests" />
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>

So here the custom object has three properties
name ---contains a name
gender ---boolean value
interests --This contains a comma separated string (Example:
music,movies, cycling, tennis)

So during Display mode.... the 'interests' field shows the comma
separated values.

But during edit mode, a text box appears in its place and the comma
separated values are populated for editing purpose...

Now when user goes into edit mode ....i want each value of the comma
separated string as a separate check box...so that the user can select
the options..

Is this possible?
What special code is to be written?
Hi...

SqlDataSource and ObjectDataSouece of Asp.net 2.0 are two fine new
feature ...
and we did liked it very much... But it seems your requirement is a
little bit different...
Asp.net site have few very good article demonastrating working with
data... and matches your need

http://www.asp.net/learn/dataaccess/....aspx?tabid=63
http://www.asp.net/learn/dataaccess/....aspx?tabid=63
http://www.asp.net/learn/dataaccess/....aspx?tabid=63

Thanks
Masudur

Jun 10 '07 #2

P: n/a
hey all,

I got a solution for this...
please refer this post..

http://forums.asp.net/t/1120050.aspx
On Jun 10, 2:59 am, Masudur <munn...@gmail.comwrote:
On Jun 8, 12:23 am, kamlesh <kamles...@gmail.comwrote:


Hi All,
I have a question on the ASP.NET 2.0 Details view control
I dont like using the SQLDataSource to bind the data to the
DetailsView control..
I dont like the idea of placing Queries in the .ASPX files...I
prefer a 3 tiered approach to
development.
Am using a Custom object to bind the object to the Details View
control at run time..
When the page loads....like this
BO.TestBO bo = new BO.TestBO();
CustomObject object = bo.GetProfileInformation(1);
this.personalInfoDetailsView.AllowPaging = false;
this.interestInfoDetailsView.AllowPaging = false;
this.personalInfoDetailsView.DataSource = object;
this.personalInfoDetailsView.DataBind();
This is the Details view control...
<asp:DetailsView CellPadding="1" Font-Names="Verdana" Width="100%">
<Fields>
<asp:BoundField DataField="name" ReadOnly="True"
SortExpression="name" />
<asp:CheckBoxField DataField="gender"
SortExpression="gender" />
<asp:BoundField DataField="interests"
ReadOnly="True"
SortExpression="interests" />
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>
So here the custom object has three properties
name ---contains a name
gender ---boolean value
interests --This contains a comma separated string (Example:
music,movies, cycling, tennis)
So during Display mode.... the 'interests' field shows the comma
separated values.
But during edit mode, a text box appears in its place and the comma
separated values are populated for editing purpose...
Now when user goes into edit mode ....i want each value of the comma
separated string as a separate check box...so that the user can select
the options..
Is this possible?
What special code is to be written?

Hi...

SqlDataSource and ObjectDataSouece of Asp.net 2.0 are two fine new
feature ...
and we did liked it very much... But it seems your requirement is a
little bit different...
Asp.net site have few very good article demonastrating working with
data... and matches your need

http://www.asp.net/learn/dataaccess/....aspx?tabid=63

Thanks
Masudur- Hide quoted text -

- Show quoted text -

Jun 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.