Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Question on Details View

Reply
Thread Tools

Question on Details View

 
 
kamlesh
Guest
Posts: n/a
 
      06-07-2007
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...
<aspetailsView 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>
</aspetailsView>

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?

 
Reply With Quote
 
 
 
 
Masudur
Guest
Posts: n/a
 
      06-10-2007
On Jun 8, 12:23 am, kamlesh <(E-Mail Removed)> wrote:
> 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...
> <aspetailsView 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>
> </aspetailsView>
>
> 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

 
Reply With Quote
 
 
 
 
kamlesh
Guest
Posts: n/a
 
      06-11-2007
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 <(E-Mail Removed)> wrote:
> On Jun 8, 12:23 am, kamlesh <(E-Mail Removed)> wrote:
>
>
>
>
>
> > 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...
> > <aspetailsView 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>
> > </aspetailsView>

>
> > 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 -



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nub Question - Details View Visibility randy.buchholz ASP .Net 4 01-08-2008 04:06 PM
Question on Details View kamlesh ASP .Net 2 06-11-2007 04:58 PM
Show Details/Hide Details link button =?Utf-8?B?Sm9l?= ASP .Net 1 03-13-2006 04:51 PM
How to make a week view and day view calendar just like month view calendar in .NET ? Parthiv Joshi ASP .Net Web Controls 1 07-06-2004 03:15 PM
Warning "Re: Your details" & "Re: My details" Joe Lee Computer Support 3 05-17-2004 05:08 PM



Advertisments