473,854 Members | 1,433 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DetailsView and template fields

I have a gridview and a details view in a page. The two are hooked up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key from
the user table indicating which user posseses that inventory. However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>

Aug 7 '06 #1
7 5428
CK
You need to specifiy the update method that will be used in your datasource
and you need some Control Update parameters. It would look something like
this.

<UpdateParamete rs>
<asp:ControlPar ameter ControlID="ddlP erson" PropertyName="S electedValue"
Name="PersonID" />

</UpdateParameter s>

Alternatively you could set the control parameter when you need it.
Something like this

ObjectDataSoure .UpdateParamete rs[0].value =
((DropDownList) dvEditItem.Find Control('ddlPer son')).Selected Value;

ObjectDataSourc e.Update();

Something like that should work for you. HTH.

~CK

<st************ *@gmail.comwrot e in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
>I have a gridview and a details view in a page. The two are hooked up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key from
the user table indicating which user posseses that inventory. However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>

Aug 7 '06 #2
Thank you for the help. I didn't know how to access the Parameters
collection.

Some feedback though:
1. I do have an Update Method specified in the ObjectDataSourc e
definition. It's UpdateItemByID.
2. If I use your first suggesstion, I get an error stating that it
cannot find Control 'ddlPerson' in ControlParamete r 'PersonID'
3. If I use your second suggestion, I don't find a "Value" property in
the UpdateParameter s collection of the ObjectDataSourc e. I find
DefaultValue, but not Value.

Thanks!

CK wrote:
You need to specifiy the update method that will be used in your datasource
and you need some Control Update parameters. It would look something like
this.

<UpdateParamete rs>
<asp:ControlPar ameter ControlID="ddlP erson" PropertyName="S electedValue"
Name="PersonID" />

</UpdateParameter s>

Alternatively you could set the control parameter when you need it.
Something like this

ObjectDataSoure .UpdateParamete rs[0].value =
((DropDownList) dvEditItem.Find Control('ddlPer son')).Selected Value;

ObjectDataSourc e.Update();

Something like that should work for you. HTH.

~CK

<st************ *@gmail.comwrot e in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
I have a gridview and a details view in a page. The two are hooked up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key from
the user table indicating which user posseses that inventory. However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>
Aug 7 '06 #3
CK
Assigning the default value to the desired value at run time should work. I
apologize I was answering that off the top of my head.

<st************ *@gmail.comwrot e in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Thank you for the help. I didn't know how to access the Parameters
collection.

Some feedback though:
1. I do have an Update Method specified in the ObjectDataSourc e
definition. It's UpdateItemByID.
2. If I use your first suggesstion, I get an error stating that it
cannot find Control 'ddlPerson' in ControlParamete r 'PersonID'
3. If I use your second suggestion, I don't find a "Value" property in
the UpdateParameter s collection of the ObjectDataSourc e. I find
DefaultValue, but not Value.

Thanks!

CK wrote:
>You need to specifiy the update method that will be used in your
datasource
and you need some Control Update parameters. It would look something like
this.

<UpdateParamet ers>
<asp:ControlPa rameter ControlID="ddlP erson" PropertyName="S electedValue"
Name="PersonID " />

</UpdateParameter s>

Alternativel y you could set the control parameter when you need it.
Something like this

ObjectDataSour e.UpdateParamet ers[0].value =
((DropDownList )dvEditItem.Fin dControl('ddlPe rson')).Selecte dValue;

ObjectDataSour ce.Update();

Something like that should work for you. HTH.

~CK

<st*********** **@gmail.comwro te in message
news:11******* *************** @m73g2000cwd.go oglegroups.com. ..
>I have a gridview and a details view in a page. The two are hooked up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key from
the user table indicating which user posseses that inventory. However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>

Aug 7 '06 #4
Sorry, I meant to include this in the last post, but when I assign the
DefaultValue, it works on the first try, but not on subsequent updates.
For example:
If I edit item 1, assigning DefaultValue works. If I try to edit item
1 again, it doesn't work.
But, if after editing item 1 I edit item 2, that works and going back
to item 1 works as well. It's like it won't work twice in a row...

Any thoughts?

Thanks!
Jason

CK wrote:
Assigning the default value to the desired value at run time should work. I
apologize I was answering that off the top of my head.

<st************ *@gmail.comwrot e in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Thank you for the help. I didn't know how to access the Parameters
collection.

Some feedback though:
1. I do have an Update Method specified in the ObjectDataSourc e
definition. It's UpdateItemByID.
2. If I use your first suggesstion, I get an error stating that it
cannot find Control 'ddlPerson' in ControlParamete r 'PersonID'
3. If I use your second suggestion, I don't find a "Value" property in
the UpdateParameter s collection of the ObjectDataSourc e. I find
DefaultValue, but not Value.

Thanks!

CK wrote:
You need to specifiy the update method that will be used in your
datasource
and you need some Control Update parameters. It would look something like
this.

<UpdateParamete rs>
<asp:ControlPar ameter ControlID="ddlP erson" PropertyName="S electedValue"
Name="PersonID" />

</UpdateParameter s>

Alternatively you could set the control parameter when you need it.
Something like this

ObjectDataSoure .UpdateParamete rs[0].value =
((DropDownList) dvEditItem.Find Control('ddlPer son')).Selected Value;

ObjectDataSourc e.Update();

Something like that should work for you. HTH.

~CK

<st************ *@gmail.comwrot e in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
I have a gridview and a details view in a page. The two are hooked up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key from
the user table indicating which user posseses that inventory. However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>
Aug 7 '06 #5
CK
try a function that returns the desired value. Like

public string getDDLvalue()
{
return
((DropDownList) dvEditItem.Find Control('ddlPer son')).Selected Value;
}

then try
ObjectDataSoure .UpdateParamete rs[0].value = getDDLValue();

Maybe that will work better for you. I am not sure.
~CK

<st************ *@gmail.comwrot e in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
Sorry, I meant to include this in the last post, but when I assign the
DefaultValue, it works on the first try, but not on subsequent updates.
For example:
If I edit item 1, assigning DefaultValue works. If I try to edit item
1 again, it doesn't work.
But, if after editing item 1 I edit item 2, that works and going back
to item 1 works as well. It's like it won't work twice in a row...

Any thoughts?

Thanks!
Jason

CK wrote:
>Assigning the default value to the desired value at run time should work.
I
apologize I was answering that off the top of my head.

<st*********** **@gmail.comwro te in message
news:11******* *************** @m73g2000cwd.go oglegroups.com. ..
Thank you for the help. I didn't know how to access the Parameters
collection.

Some feedback though:
1. I do have an Update Method specified in the ObjectDataSourc e
definition. It's UpdateItemByID.
2. If I use your first suggesstion, I get an error stating that it
cannot find Control 'ddlPerson' in ControlParamete r 'PersonID'
3. If I use your second suggestion, I don't find a "Value" property in
the UpdateParameter s collection of the ObjectDataSourc e. I find
DefaultValue, but not Value.

Thanks!

CK wrote:
You need to specifiy the update method that will be used in your
datasource
and you need some Control Update parameters. It would look something
like
this.

<UpdateParamet ers>
<asp:ControlPa rameter ControlID="ddlP erson"
PropertyName=" SelectedValue"
Name="PersonID " />

</UpdateParameter s>

Alternativel y you could set the control parameter when you need it.
Something like this

ObjectDataSour e.UpdateParamet ers[0].value =
((DropDownList )dvEditItem.Fin dControl('ddlPe rson')).Selecte dValue;

ObjectDataSour ce.Update();

Something like that should work for you. HTH.

~CK

<st*********** **@gmail.comwro te in message
news:11******* *************** @m73g2000cwd.go oglegroups.com. ..
I have a gridview and a details view in a page. The two are hooked
up,
so that when a row is selected in the GridView, the DetailsView
displays the details. But, what I'm trying to accomplish is this:

I have two tables - user and item.
user table:
user_id int
user_name varchar(50)

item table:
item_id int
user_id int (foreign key from user table)
item_name varchar(50)

The item table contains inventory items and it has a foreign key
from
the user table indicating which user posseses that inventory.
However,
when editing this item, if I need to change the user to whom it is
assigned, I want to display the user's name rather than the users id
from the item table in a DropDownList in the DetailsView. So what I
have done to accomplish this is create a TemplateField that holds a
DropDownList and an ObjectDataSourc e that populates the DDL with all
of
the possible users. And in the DataBound event, I select the user's
name in the DDL to whom the item is currently assigned. But I don't
know how to capture the selected user'd id and pass it to the Update
method in the ObjectDataSourc e for the DetailsView. I hope this has
been clear...

Here is some code:
<asp:DetailsVie w ID="dvEditItem " runat="server" Height="50px"
GridLines="None " AutoGenerateRow s="False" DataKeyNames="i nv_item_id"
DataSourceID="o dsInventoryItem " DefaultMode="Ed it"
OnItemUpdated=" dvEditItem_Item Updated" >
<Fields>
<asp:TemplateFi eld HeaderText="Use r"
SortExpression= "inv_person_id" >
<EditItemTempla te>
<asp:DropDownLi st ID="ddlPerson" runat="server"
CssClass="textG rey10" DataSourceID="o dsInventoryPers on"
DataTextField=" corp_person_ful lname"
DataValueField= "corp_person_id " Width="244px"
OnDataBound="dd lPerson_DataBou nd">
</asp:DropDownLis t>
<asp:ObjectData Source ID="odsInventor yPerson" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etUndeletedPeop le"
TypeName="dsPer sonTableAdapter s.tbcorp_person TableAdapter">
</asp:ObjectDataS ource>
</EditItemTemplat e>
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="inv_ item_descriptio n"
HeaderText="Des cription" SortExpression= "inv_item_descr iption">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_serial" HeaderText="Ser ial
Number" SortExpression= "inv_item_seria l">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_workauthor ization"
HeaderText="Wor k Authorization"
SortExpression= "inv_item_worka uthorization">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_purchaseco st"
HeaderText="Pur chase Cost" SortExpression= "inv_item_purch asecost">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_podate" HeaderText="PO Date"
SortExpression= "inv_item_podat e">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_warrantyex piration"
HeaderText="War ranty Expires"
SortExpression= "inv_item_warra ntyexpiration">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicenum ber"
HeaderText="Inv oice Number" SortExpression= "inv_item_invoi cenumber">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:BoundFie ld DataField="inv_ item_invoicedat e"
HeaderText="Inv oice Date" SortExpression= "inv_item_invoi cedate">
<ControlStyle CssClass="detai lsViewControlSm all" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:BoundField>
<asp:CheckBoxFi eld DataField="inv_ item_active"
HeaderText="Act ive" SortExpression= "inv_item_activ e">
<ItemStyle HorizontalAlign ="Left" Width="50px" />
<HeaderStyle CssClass="detai lsViewHeaderTex t" />
</asp:CheckBoxFie ld>
<asp:CommandFie ld ButtonType="But ton" ShowCancelButto n="False"
ShowEditButton= "True">
<ControlStyle CssClass="textG rey10" />
</asp:CommandFiel d>
</Fields>
</asp:DetailsView >
<asp:ObjectData Source ID="odsInventor yItem" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etInventoryItem ByID"
TypeName="dsIte mTableAdapters. tbinv_itemTable Adapter"
UpdateMethod="U pdateItemByID" >
<UpdateParamete rs>
<asp:Paramete r Name="corp_pers on_id" Type="Int32" />
<asp:Paramete r Name="inv_item_ description" Type="String" />
<asp:Paramete r Name="inv_item_ serial" Type="String" />
<asp:Paramete r Name="inv_item_ workauthorizati on" Type="String"
/>
<asp:Paramete r Name="inv_item_ purchasecost" Type="Single" />
<asp:Paramete r Name="inv_item_ podate" Type="DateTime" />
<asp:Paramete r Name="inv_item_ active" Type="Boolean" />
<asp:Paramete r Name="inv_item_ warrantyexpirat ion"
Type="DateTime" />
<asp:Paramete r Name="inv_item_ invoicenumber" Type="String" />
<asp:Paramete r Name="inv_item_ invoicedate" Type="DateTime" />
<asp:Paramete r Name="Original_ inv_item_id" Type="Int32" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="gvIt emList" Name="inv_item_ id"
PropertyName="S electedValue"
Type="Int32" />
</SelectParameter s>
</asp:ObjectDataS ource>


Aug 7 '06 #6
That didn't work.

I'll keep looking, but thank you for your help! If you do think of
something else, though, let me know.

Jason

Aug 7 '06 #7
CK
When are you trying to retreive and set the value?
Try it in the ObjectDataSourc e1_Updating event. You'll need to register that
event. Probably like in the PageLoad event
Try retrieving and setting the value in that event maybe. Sorry i wish i
could help you more.

<st************ *@gmail.comwrot e in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
That didn't work.

I'll keep looking, but thank you for your help! If you do think of
something else, though, let me know.

Jason

Aug 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10074
by: Shawn Wildermuth | last post by:
I have a *single* SqlDataSource that loads up a single result set that I show in a GridView. In the GridView, i've added a "Select" button and handling the SelectedItem event. I also have a DetailsView (though FormView has this same issue) where I want to be able to set the current item to bind to from the DataSource. All the examples I've seen use two data sources and on every *select* they do another round-trip to the Database (which...
12
8711
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
1
2424
by: vbnetdev | last post by:
I need to customize the DetailsView New record (insert) so that it gets the maximum value of ROWID and adds 1, places that value in the textbox and makes it read only. Also, I have a field called "DATEEVENT". I would like to place a calendar control there instead of the textbox that is shown. Thanks for any help. -- Get a powerful web, database, application, and email hosting with KJM
3
4078
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource 'ObjectDataSource1' has no values to insert. Check that the 'values' dictionary contains values." I have found I can suppress the error by placing a hidden field inside
5
11356
by: Mike P | last post by:
The default format for the DetailsView control is for there to be a row per field. Is it possible set it to show more than one column per row (see below)? ID ... Name ... Address ... Country ... etc. I have tried to add <tr>'s and <td>'s within the DetailsView to do this, but it just causes errors.
4
7722
by: Kjell Arne | last post by:
Hi! I have a detailsview control in a webpart with some templated fields on. I set the ValidationGroup property to som value on these fields to distinguish from other web parts on the page. However, I'm not able to set the same ValidationGroup on the submit controls on the detailsview. Those linkbuttons(update, insert) are auto generated now. 1. Is it possible to set ValidationGroup on the detailsview? 2. How would I go about...
2
16217
by: Cas | last post by:
Hi, I use a detailsview control for inputtng data. I want to check the user input before it is sent to the database (min. /max value, not empty, only some values allowed ...). When clicking on the insertbutton, i want a warning if one or more inputs are not correct and the user must have the opportunity to correct his errors (so all the fields must remains as it). I know it exists e.g. "RequiredFieldValidator", but i can't link it to...
1
7737
by: Timothy H. Schilbach | last post by:
Hi Everyone, I am having a massive issue trying to get custom data into my DV. What I want to do is sooo simple: 1. I have a single DV on a page 2. I created my own template (see below) 3. I created the DetailsViewDataBinging sub which populates the field using a datatable 4. I created a ModeChanging Event handler to allow me to change the mode
5
3473
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration: default.aspx:
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9751
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10679
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7914
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5941
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3186
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.