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




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com