.NETGURU
Adding static values in columns to an ObjectList
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngmob' list.


Neil Raybould
Is there a way to create static columns to an ObjectList on a Mobile Web
Form populated from a dataset?
=20
For instance, I want to add "Add", "Edit" and "Delete" values in my
table. Can I do this? Should I be using another control?
=20
---------------------------------------------
Header 1 | Header 2 | Header 3 | Header 4 |
---------------------------------------------
Add | Edit | Delete | <Data> |=20
Add | Edit | Delete | <Data> |=20
Add | Edit | Delete | <Data> |=20
Add | Edit | Delete | <Data> |=20
=20
=20

Reply to this message...
 
    
Anil John
Neil,

I don't think this type of formatting is available witht the ObjectList.
Even if it was I would think that a tabular format would work only with a
browser such as PocketIE that supports tables..

An option that you might want to consider that allows you to do the
edits/updates and still allows auto generation of the markup in other
devices might be something along the lines of:
-----------------------------
<script runat="server">
protected void Page_Load(Object sender, EventArgs e) {
    // Data access code
    lstAuthor.DataBind();
}

protected void ObjectList_ItemCommand(Object sender,
ObjectListCommandEventArgs e)
{
    switch (e.CommandName) {
        case "Edit":
            // fill frmEdit for editing
            ActiveForm = frmEdit;
            break;
        case "Delete":
            // Delete here
            break;
    }
}

void cmdUpdate_Activate(Object sender, EventArgs e) {
// Update here...
}

void cmdCancel_Activate(Object sender, EventArgs e) {
// Cancel here...
}

</script>

<Mobile:Form runat="server" id="FirstForm">
    <mobile:ObjectList runat="server" OnItemCommand="ObjectList_ItemCommand"
        AutoGenerateFields="false" id="lstAuthor" LabelField="au_lname"
        >
        <Field DataField="au_lname" Title="Last Name" visible="false" />
        <Field DataField="city" Title="City Name" />
        <Field DataField="state" Title="State Name" />

        <Command Name="Edit" Text="Edit Author" />
        <Command Name="Delete" Text="Delete Author" />

</mobile:ObjectList>
</Mobile:Form>

<Mobile:Form runat="server" id="frmEdit">
    <mobile:Textbox id="txtCityEdit" runat="server" />
    <mobile:Textbox id="txtStateEdit" runat="server" />
    <mobile:Command runat="server" Text="Update" OnClick="cmdUpdate_Activate"
/>
    <mobile:Command runat="server" Text="Cancel" OnClick="cmdCancel_Activate"
/>
</Mobile:Form>
-----------------------------

It would appear that from the pic that you drew that you are trying to
basically get the in place editing functionality of the datagrid. If your
target platform is ONLY a pocket pc, have you considered just using a
regular datagrid web form control, but with the width constrained to the
pocket pc screen size (I personally have not tried it other than confirming
that a tablular datagrid will display on an iPaq, so no idea if it even
feasable, but something to consider).

Anil

-----Original Message-----
From: Neil Raybould [mailto:Click here to reveal e-mail address]
Sent: Thursday, February 28, 2002 10:07 AM
To: aspngmob
Subject: [aspngmob] Adding static values in columns to an ObjectList

Is there a way to create static columns to an ObjectList on a Mobile Web
Form populated from a dataset?

For instance, I want to add "Add", "Edit" and "Delete" values in my
table. Can I do this? Should I be using another control?

---------------------------------------------
Header 1 | Header 2 | Header 3 | Header 4 |
---------------------------------------------
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |

| [aspngmob] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngmob.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Shanku Niyogi
You can also try using a templated rendering on the Pocket PC, with an
ItemTemplate that includes static commands. The QuickStart has an
example of this.

Shanku

--
This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: Anil John [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, February 28, 2002 9:11 PM
To: aspngmob
Subject: [aspngmob] RE: Adding static values in columns to an ObjectList

Neil,

I don't think this type of formatting is available witht the ObjectList.
Even if it was I would think that a tabular format would work only with
a browser such as PocketIE that supports tables..

An option that you might want to consider that allows you to do the
edits/updates and still allows auto generation of the markup in other
devices might be something along the lines of:
-----------------------------
<script runat=3D"server">
protected void Page_Load(Object sender, EventArgs e) {
    // Data access code
    lstAuthor.DataBind();
}

protected void ObjectList_ItemCommand(Object sender,
ObjectListCommandEventArgs e) {
    switch (e.CommandName) {
        case "Edit":
            // fill frmEdit for editing
            ActiveForm =3D frmEdit;
            break;
        case "Delete":
            // Delete here
            break;
    }
}

void cmdUpdate_Activate(Object sender, EventArgs e) {
// Update here...
}

void cmdCancel_Activate(Object sender, EventArgs e) {
// Cancel here...
}

</script>

<Mobile:Form runat=3D"server" id=3D"FirstForm">
    <mobile:ObjectList runat=3D"server"
OnItemCommand=3D"ObjectList_ItemCommand"
        AutoGenerateFields=3D"false" id=3D"lstAuthor"
LabelField=3D"au_lname"
        >
        <Field DataField=3D"au_lname" Title=3D"Last Name"
visible=3D"false" />
        <Field DataField=3D"city" Title=3D"City Name" />
        <Field DataField=3D"state" Title=3D"State Name" />

        <Command Name=3D"Edit" Text=3D"Edit Author" />
        <Command Name=3D"Delete" Text=3D"Delete Author" />

</mobile:ObjectList>
</Mobile:Form>

<Mobile:Form runat=3D"server" id=3D"frmEdit">
    <mobile:Textbox id=3D"txtCityEdit" runat=3D"server" />
    <mobile:Textbox id=3D"txtStateEdit" runat=3D"server" />
    <mobile:Command runat=3D"server" Text=3D"Update"
OnClick=3D"cmdUpdate_Activate" />
    <mobile:Command runat=3D"server" Text=3D"Cancel"
OnClick=3D"cmdCancel_Activate" /> </Mobile:Form>
-----------------------------

It would appear that from the pic that you drew that you are trying to
basically get the in place editing functionality of the datagrid. If
your target platform is ONLY a pocket pc, have you considered just using
a regular datagrid web form control, but with the width constrained to
the pocket pc screen size (I personally have not tried it other than
confirming that a tablular datagrid will display on an iPaq, so no idea
if it even feasable, but something to consider).

Anil

-----Original Message-----
From: Neil Raybould [mailto:Click here to reveal e-mail address]
Sent: Thursday, February 28, 2002 10:07 AM
To: aspngmob
Subject: [aspngmob] Adding static values in columns to an ObjectList

Is there a way to create static columns to an ObjectList on a Mobile Web
Form populated from a dataset?

For instance, I want to add "Add", "Edit" and "Delete" values in my
table. Can I do this? Should I be using another control?

---------------------------------------------
Header 1 | Header 2 | Header 3 | Header 4 |
---------------------------------------------
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |
Add | Edit | Delete | <Data> |

| [aspngmob] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngmob.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

| [aspngmob] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngmob.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Harry I
Hi,

Can you please point me to an example or send me an example VB.NET CODE (syntax) elaborating on how to
bind data from Oracle database to either mobile:list or the mobile:objectlist (preferably mobile:list)
programatically and NOT via/using the VS.NET GUI.

I am developing an application for HP's iPaq and want to bind data to anyone of them aforementioned lists programatically so that users can see data in the list and I also need to provide the users with an option to edit/update each record.

I am new at .NET and using ASP.NET and VB.NET. I would really and truly appreciate your help. I have a very tight deadline to complete this task.

Thanks,
Reply to this message...
 
 
System.EventArgs
System.Web.UI.MobileControls.ObjectList
System.Web.UI.MobileControls.ObjectListCommandEventArgs




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification