You're welcome Mirek,
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Mirek Endys" <Mi****@community.nospam>
| References: <e6**************@TK2MSFTNGP12.phx.gbl>
<HU**************@TK2MSFTNGXA02.phx.gbl>
<M$**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: DataItem in DataListItem is null.
| Date: Fri, 25 Nov 2005 13:33:56 +0100
| Lines: 170
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <O8**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: gw.coty.cz 195.47.52.129
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:360889
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks, it works well.
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:M$**************@TK2MSFTNGXA02.phx.gbl...
| > Hi Mirek,
| >
| > How are you doing on this issue , does the suggestion in my last reply
| > helps a little?
| > If threre're anything else we can help, please feel free to post here.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| > --------------------
| > | X-Tomcat-ID: 27416236
| > | References: <e6**************@TK2MSFTNGP12.phx.gbl>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From:
st*****@online.microsoft.com (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Tue, 22 Nov 2005 01:24:42 GMT
| > | Subject: RE: DataItem in DataListItem is null.
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | Message-ID: <HU**************@TK2MSFTNGXA02.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | Lines: 102
| > | Path: TK2MSFTNGXA02.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:360011
| > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| > |
| > | Hi Mirek,
| > |
| > | Welcome to ASPNET newsgroup.
| > | Regarding on the DataList databinding with Generic List instance
| > problem,
| > I
| > | think we should use the DataList's "ItemDataBound" event instead of
the
| > | "ItemCommand" event. The "Itemcommand" event is used for processing
| > | DataList's Postback events , such as "Edit", "update".... If we
need
| > to
| > | programmatically access the current bound datasource's dataitems and
do
| > | customization on the DataList's inner Control with the DataItem, we
| > should
| > | use the "ItemDataBound" event , this event will be fired when each
| > DataItem
| > | has been bound to the DataList's certain Row.....
| > |
| > | If there're anything else unclear, please feel free to post here.
| > |
| > | Thanks,
| > |
| > | Steven Cheng
| > | Microsoft Online Support
| > |
| > | Get Secure!
www.microsoft.com/security
| > | (This posting is provided "AS IS", with no warranties, and confers no
| > | rights.)
| > |
| > |
| > |
| > |
| > | --------------------
| > | | From: "Mirek Endys" <Mi****@community.nospam>
| > | | Subject: DataItem in DataListItem is null.
| > | | Date: Mon, 21 Nov 2005 10:01:33 +0100
| > | | Lines: 67
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | | X-RFC2646: Format=Flowed; Original
| > | | Message-ID: <e6**************@TK2MSFTNGP12.phx.gbl>
| > | | Newsgroups:
| > |
| >
microsoft.public.dotnet.framework.aspnet,microsoft .public.dotnet.framework.a
| > | spnet.webcontrols
| > | | NNTP-Posting-Host: gw.coty.cz 195.47.52.129
| > | | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | | Xref: TK2MSFTNGXA02.phx.gbl
| > | microsoft.public.dotnet.framework.aspnet.webcontro ls:31227
| > | microsoft.public.dotnet.framework.aspnet:359739
| > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | |
| > | | Hello,
| > | |
| > | | the problem I have now, is:
| > | |
| > | | Im binding generic collection based on List<iDB2SQLTransferItem> //
| > | | iDB2SQLTransferItem is my class // into WebCOntrol DataList. But the
| > | | DataItem of the DataListCommandEventArgs is null. Here is my code:
| > | |
| > | | private MyData.iDB2SQLTransfers transfers = null;
| > | |
| > | | protected void Page_Load(object sender, EventArgs e)
| > | | {
| > | | AppSettingsReader apReader = new AppSettingsReader();
| > | | string dtdPath = (string)apReader.GetValue("DTDPath",
| > typeof(string));
| > | | transfers = iDB2SQLTransfers.Load(dtdPath);
| > | | this.dlDTDefinitions.DataSource = transfers;
| > | | this.dlDTDefinitions.DataBind();
| > | | }
| > | |
| > | | protected void dlDTDefinitions_ItemCommand(object source,
| > | | DataListCommandEventArgs e)
| > | | {
| > | | switch(e.CommandName)
| > | | {
| > | |
| > | | case "Save":
| > | | // Here i suppose, that in the DataItem is edited item
| > typeof
| > | | iDB2SQLTransferItem
| > | | // but it is null. (ListItemType is right - EditItem)
| > | | iDB2SQLTransferItem item =
| > | (iDB2SQLTransferItem)e.Item.DataItem
| > | | dlDTDefinitions.EditItemIndex = -1;
| > | | dlDTDefinitions.SelectedIndex = e.Item.ItemIndex;
| > | | break;
| > | | }
| > | |
| > | | ---------------------------------------------
| > | | Code in aspx page // Only EditItemTemplate //
| > | | ---------------------------------------------
| > | |
| > | | <EditItemTemplate>
| > | | <table>
| > | | <tr>
| > | | <td>ID:</td>
| > | | <td nowrap="nowrap" valign="top"><%#
| > | | DataBinder.Eval(Container.DataItem, "ID")%></td>
| > | | <td>Caption:</td>
| > | | <td>
| > | | <asp:TextBox ID="txtCaption" runat="server"
Text='<%#
| > | | DataBinder.Eval(Container.DataItem, "Caption")
%>'></asp:TextBox></td>
| > | | <td>Description:</td>
| > | | <td>
| > | | <asp:TextBox ID="txtDescription" runat="server"
| > | | Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'
| > | | ></asp:TextBox></td>
| > | | </tr>
| > | | </table>
| > | |
| > | | ==================================================
| > | |
| > | | All is working well, data are viewed, commands are working well,
but
| > on
| > | Save
| > | | command I need to get edited iDB2SQLTransferItem and save it.
| > | |
| > | | Thanks for ideas.
| > | |
| > | | Mirek
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|