473,382 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Question on Details View

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
2 1471
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Derck | last post by:
SORRY, for the crosspost, but I think I posted it in the wrong group! Hello all, I have a question.. I am tying to make a global listview class where other listviews in my application points...
10
by: > Adrian | last post by:
I am getting these errors: DrawListViewItemEventArgs' could not be found DrawListViewSubItemEventArgs' could not be found DrawListViewColumnHeaderEventArgs' could not be found I am already...
4
by: randy.buchholz | last post by:
Been fighting this one for a while, looking for help. I have a simple page with a grid view and details view (just managing a single table). The details view is primarily used for creating new...
1
by: baldrick | last post by:
I have a listview that I set to view.details with the following code... With Me.ListView .View = View.Details But when I add the declaration Imports ADOX
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.