|
|
|
start date: Sat, 28 Jul 2007 17:02:12 +0200,
posted on: microsoft.public.dotnet.framework.aspnet.buildingcontrols
back
| Thread Index |
|
1
Chris
|
|
2
chenhong
|
|
3
chenhong
|
|
4
Chris
|
|
5
Chris
|
|
6
chenhong
|
|
7
chenhong
|
|
8
Chris
|
|
9
Chris
|
how to get the value of a field in a detailsview?
I need the value of a field of a detailsview in DataBound event.
i can find the fieldname with this:
Dim a As DataControlField
a = DetailsView1.Fields(0)
But how to get the value of that field?
i tried a lot of things without succes:
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
dim enqna as DetailsViewRow
enqna = DetailsView1.DataItem
or
dim enqna As DataColumn
enqna= DetailsView1.DataItem
.....
or
Dim va As String
va = DetailsView1.Controls.Item(1).ToString
Thanks for help
Chris
Date:Sat, 28 Jul 2007 17:02:12 +0200
Author:
|
Re: how to get the value of a field in a detailsview?
you could get the value of the field by get the value of the corresponding
label control value of the field.
the lable load event should do the trick.
"Chris" дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>I need the value of a field of a detailsview in DataBound event.
> i can find the fieldname with this:
> Dim a As DataControlField
> a = DetailsView1.Fields(0)
>
> But how to get the value of that field?
> i tried a lot of things without succes:
> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DetailsView1.DataBound
> dim enqna as DetailsViewRow
> enqna = DetailsView1.DataItem
>
> or
>
> dim enqna As DataColumn
> enqna= DetailsView1.DataItem
> ....
> or
> Dim va As String
> va = DetailsView1.Controls.Item(1).ToString
>
> Thanks for help
> Chris
>
Date:Sun, 29 Jul 2007 08:25:02 +0800
Author:
|
Re: how to get the value of a field in a detailsview?
you could get the value of the field by get the value of the corresponding
label control value of the field.
the lable load event should do the trick.
"Chris" дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>I need the value of a field of a detailsview in DataBound event.
> i can find the fieldname with this:
> Dim a As DataControlField
> a = DetailsView1.Fields(0)
>
> But how to get the value of that field?
> i tried a lot of things without succes:
> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DetailsView1.DataBound
> dim enqna as DetailsViewRow
> enqna = DetailsView1.DataItem
>
> or
>
> dim enqna As DataColumn
> enqna= DetailsView1.DataItem
> ....
> or
> Dim va As String
> va = DetailsView1.Controls.Item(1).ToString
>
> Thanks for help
> Chris
>
Date:Sun, 29 Jul 2007 08:25:02 +0800
Author:
|
Re: how to get the value of a field in a detailsview?
Hi, thanks for replying.
I ommit to mention that the fields are templatefields, like this:
<asp:TemplateField SortExpression="enqna">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
%>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
%>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
</asp:TemplateField>
So there is no 'label1a' load event (the value i'm interesting it).
Thanks
"chenhong" schreef in bericht
news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
> you could get the value of the field by get the value of the corresponding
> label control value of the field.
> the lable load event should do the trick.
>
> "Chris"
> дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>I need the value of a field of a detailsview in DataBound event.
>> i can find the fieldname with this:
>> Dim a As DataControlField
>> a = DetailsView1.Fields(0)
>>
>> But how to get the value of that field?
>> i tried a lot of things without succes:
>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles DetailsView1.DataBound
>> dim enqna as DetailsViewRow
>> enqna = DetailsView1.DataItem
>>
>> or
>>
>> dim enqna As DataColumn
>> enqna= DetailsView1.DataItem
>> ....
>> or
>> Dim va As String
>> va = DetailsView1.Controls.Item(1).ToString
>>
>> Thanks for help
>> Chris
>>
>
>
Date:Sun, 29 Jul 2007 10:17:53 +0200
Author:
|
Re: how to get the value of a field in a detailsview?
Hi, thanks for replying.
I ommit to mention that the fields are templatefields, like this:
<asp:TemplateField SortExpression="enqna">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
%>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
%>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
</asp:TemplateField>
So there is no 'label1a' load event (the value i'm interesting it).
Thanks
"chenhong" schreef in bericht
news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
> you could get the value of the field by get the value of the corresponding
> label control value of the field.
> the lable load event should do the trick.
>
> "Chris"
> дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>I need the value of a field of a detailsview in DataBound event.
>> i can find the fieldname with this:
>> Dim a As DataControlField
>> a = DetailsView1.Fields(0)
>>
>> But how to get the value of that field?
>> i tried a lot of things without succes:
>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles DetailsView1.DataBound
>> dim enqna as DetailsViewRow
>> enqna = DetailsView1.DataItem
>>
>> or
>>
>> dim enqna As DataColumn
>> enqna= DetailsView1.DataItem
>> ....
>> or
>> Dim va As String
>> va = DetailsView1.Controls.Item(1).ToString
>>
>> Thanks for help
>> Chris
>>
>
>
Date:Sun, 29 Jul 2007 10:17:53 +0200
Author:
|
Re: how to get the value of a field in a detailsview?
this question is the same as your another question,
see the reply there.
"Chris" дϢ:ubBG3jb0HHA.4568@TK2MSFTNGP03.phx.gbl...
> Hi, thanks for replying.
> I ommit to mention that the fields are templatefields, like this:
> <asp:TemplateField SortExpression="enqna">
> <EditItemTemplate>
> <asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
> %>'></asp:Label>
> </EditItemTemplate>
> <ItemTemplate>
> <asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
> %>'></asp:Label>
> </ItemTemplate>
> <ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
> </asp:TemplateField>
>
> So there is no 'label1a' load event (the value i'm interesting it).
> Thanks
>
> "chenhong" schreef in bericht
> news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
>> you could get the value of the field by get the value of the
>> corresponding label control value of the field.
>> the lable load event should do the trick.
>>
>> "Chris" дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>>I need the value of a field of a detailsview in DataBound event.
>>> i can find the fieldname with this:
>>> Dim a As DataControlField
>>> a = DetailsView1.Fields(0)
>>>
>>> But how to get the value of that field?
>>> i tried a lot of things without succes:
>>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>>> System.EventArgs) Handles DetailsView1.DataBound
>>> dim enqna as DetailsViewRow
>>> enqna = DetailsView1.DataItem
>>>
>>> or
>>>
>>> dim enqna As DataColumn
>>> enqna= DetailsView1.DataItem
>>> ....
>>> or
>>> Dim va As String
>>> va = DetailsView1.Controls.Item(1).ToString
>>>
>>> Thanks for help
>>> Chris
>>>
>>
>>
>
>
Date:Sun, 29 Jul 2007 21:48:44 +0800
Author:
|
Re: how to get the value of a field in a detailsview?
this question is the same as your another question,
see the reply there.
"Chris" дϢ:ubBG3jb0HHA.4568@TK2MSFTNGP03.phx.gbl...
> Hi, thanks for replying.
> I ommit to mention that the fields are templatefields, like this:
> <asp:TemplateField SortExpression="enqna">
> <EditItemTemplate>
> <asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
> %>'></asp:Label>
> </EditItemTemplate>
> <ItemTemplate>
> <asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
> %>'></asp:Label>
> </ItemTemplate>
> <ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
> </asp:TemplateField>
>
> So there is no 'label1a' load event (the value i'm interesting it).
> Thanks
>
> "chenhong" schreef in bericht
> news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
>> you could get the value of the field by get the value of the
>> corresponding label control value of the field.
>> the lable load event should do the trick.
>>
>> "Chris" дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>>I need the value of a field of a detailsview in DataBound event.
>>> i can find the fieldname with this:
>>> Dim a As DataControlField
>>> a = DetailsView1.Fields(0)
>>>
>>> But how to get the value of that field?
>>> i tried a lot of things without succes:
>>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>>> System.EventArgs) Handles DetailsView1.DataBound
>>> dim enqna as DetailsViewRow
>>> enqna = DetailsView1.DataItem
>>>
>>> or
>>>
>>> dim enqna As DataColumn
>>> enqna= DetailsView1.DataItem
>>> ....
>>> or
>>> Dim va As String
>>> va = DetailsView1.Controls.Item(1).ToString
>>>
>>> Thanks for help
>>> Chris
>>>
>>
>>
>
>
Date:Sun, 29 Jul 2007 21:48:44 +0800
Author:
|
Re: how to get the value of a field in a detailsview?
This has been solved.
Thanks for your help.
"chenhong" schreef in bericht
news:%23J2yvce0HHA.4916@TK2MSFTNGP03.phx.gbl...
> this question is the same as your another question,
> see the reply there.
>
>
> "Chris"
> дϢ:ubBG3jb0HHA.4568@TK2MSFTNGP03.phx.gbl...
>> Hi, thanks for replying.
>> I ommit to mention that the fields are templatefields, like this:
>> <asp:TemplateField SortExpression="enqna">
>> <EditItemTemplate>
>> <asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
>> %>'></asp:Label>
>> </EditItemTemplate>
>> <ItemTemplate>
>> <asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
>> %>'></asp:Label>
>> </ItemTemplate>
>> <ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
>> </asp:TemplateField>
>>
>> So there is no 'label1a' load event (the value i'm interesting it).
>> Thanks
>>
>> "chenhong" schreef in bericht
>> news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>> you could get the value of the field by get the value of the
>>> corresponding label control value of the field.
>>> the lable load event should do the trick.
>>>
>>> "Chris"
>>> дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>>>I need the value of a field of a detailsview in DataBound event.
>>>> i can find the fieldname with this:
>>>> Dim a As DataControlField
>>>> a = DetailsView1.Fields(0)
>>>>
>>>> But how to get the value of that field?
>>>> i tried a lot of things without succes:
>>>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>>>> System.EventArgs) Handles DetailsView1.DataBound
>>>> dim enqna as DetailsViewRow
>>>> enqna = DetailsView1.DataItem
>>>>
>>>> or
>>>>
>>>> dim enqna As DataColumn
>>>> enqna= DetailsView1.DataItem
>>>> ....
>>>> or
>>>> Dim va As String
>>>> va = DetailsView1.Controls.Item(1).ToString
>>>>
>>>> Thanks for help
>>>> Chris
>>>>
>>>
>>>
>>
>>
>
>
Date:Sun, 29 Jul 2007 22:34:28 +0200
Author:
|
Re: how to get the value of a field in a detailsview?
This has been solved.
Thanks for your help.
"chenhong" schreef in bericht
news:%23J2yvce0HHA.4916@TK2MSFTNGP03.phx.gbl...
> this question is the same as your another question,
> see the reply there.
>
>
> "Chris"
> дϢ:ubBG3jb0HHA.4568@TK2MSFTNGP03.phx.gbl...
>> Hi, thanks for replying.
>> I ommit to mention that the fields are templatefields, like this:
>> <asp:TemplateField SortExpression="enqna">
>> <EditItemTemplate>
>> <asp:Label ID="Label1" runat="server" Text='<%# Eval("enqna")
>> %>'></asp:Label>
>> </EditItemTemplate>
>> <ItemTemplate>
>> <asp:Label ID="Label1a" runat="server" Text='<%# Bind("enqna")
>> %>'></asp:Label>
>> </ItemTemplate>
>> <ItemStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign=Center />
>> </asp:TemplateField>
>>
>> So there is no 'label1a' load event (the value i'm interesting it).
>> Thanks
>>
>> "chenhong" schreef in bericht
>> news:Oj2$obX0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>> you could get the value of the field by get the value of the
>>> corresponding label control value of the field.
>>> the lable load event should do the trick.
>>>
>>> "Chris"
>>> дϢ:OIDzIhS0HHA.1208@TK2MSFTNGP03.phx.gbl...
>>>>I need the value of a field of a detailsview in DataBound event.
>>>> i can find the fieldname with this:
>>>> Dim a As DataControlField
>>>> a = DetailsView1.Fields(0)
>>>>
>>>> But how to get the value of that field?
>>>> i tried a lot of things without succes:
>>>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>>>> System.EventArgs) Handles DetailsView1.DataBound
>>>> dim enqna as DetailsViewRow
>>>> enqna = DetailsView1.DataItem
>>>>
>>>> or
>>>>
>>>> dim enqna As DataColumn
>>>> enqna= DetailsView1.DataItem
>>>> ....
>>>> or
>>>> Dim va As String
>>>> va = DetailsView1.Controls.Item(1).ToString
>>>>
>>>> Thanks for help
>>>> Chris
>>>>
>>>
>>>
>>
>>
>
>
Date:Sun, 29 Jul 2007 22:34:28 +0200
Author:
|
|
|