|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Boundfield display valueHi
I have a <asp:Boundfield> which returns the value of a datasource field. Can I have the text display something else depending on the value of the field ? Let's say Field Contents Display 1 a 2 b 3 c 4 d 5 e Thanks Peter "Peter" <peter***@msn.com> wrote in message
http://forums.asp.net/p/1190117/2058828.aspx#2058828
news:%23BEmOgn9JHA.1380@TK2MSFTNGP02.phx.gbl... > I have a <asp:Boundfield> which returns the value of a datasource field. > Can I have the text display something else depending on the value of the > field? http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx Thanks Mark but what's the subsitute for RowDataBound in DetailsView
Show quoteHide quote "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message news:uOZczbo9JHA.4176@TK2MSFTNGP02.phx.gbl... > "Peter" <peter***@msn.com> wrote in message news:%23BEmOgn9JHA.1380@TK2MSFTNGP02.phx.gbl... > >> I have a <asp:Boundfield> which returns the value of a datasource field. Can I have the text display something else depending on >> the value of the field? > > http://forums.asp.net/p/1190117/2058828.aspx#2058828 > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net "Peter" <peter***@msn.com> wrote in message [please don't top-post]news:Of36%23yu9JHA.4204@TK2MSFTNGP04.phx.gbl... >>> I have a <asp:Boundfield> which returns the value of a datasource field. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.itemcreated.aspx>>> Can I have the text display something else depending on the value of the >>> field? >> >> http://forums.asp.net/p/1190117/2058828.aspx#2058828 >> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx > > Thanks Mark but what's the substitute for RowDataBound in DetailsView Thanks Mark.. I got it both in my Gridview and DetailsView. But one last question, in a GridView, I need to use Cells[0], Cells[1],
Cells[3], etc.... to refer to the cell contents in displayed order. .. What if I add or remove a boundfield later on, I need to chagne the reference number all over the place.. Can I refer to the Field name directly somehow ? Regards, Peter Show quoteHide quote "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message news:O9eb9Mw9JHA.4948@TK2MSFTNGP04.phx.gbl... > "Peter" <peter***@msn.com> wrote in message news:Of36%23yu9JHA.4204@TK2MSFTNGP04.phx.gbl... > > [please don't top-post] > >>>> I have a <asp:Boundfield> which returns the value of a datasource field. Can I have the text display something else depending >>>> on the value of the field? >>> >>> http://forums.asp.net/p/1190117/2058828.aspx#2058828 >>> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx >> >> Thanks Mark but what's the substitute for RowDataBound in DetailsView > > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.itemcreated.aspx > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net "Peter" <peter***@msn.com> wrote in message *** [please don't top-post] ***news:eqrq6Fz9JHA.1488@TK2MSFTNGP03.phx.gbl... http://www.caliburn.nl/topposting.html >>>>> I have a <asp:Boundfield> which returns the value of a datasource That's correct.>>>>> field. Can I have the text display something else depending on the >>>>> value of the field? >>>> >>>> http://forums.asp.net/p/1190117/2058828.aspx#2058828 >>>> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx >>> >>> Thanks Mark but what's the substitute for RowDataBound in DetailsView >> >> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.itemcreated.aspx > > in a GridView, I need to use Cells[0], Cells[1], Cells[3], etc.... to > refer to the cell contents in displayed order. .. > What if I add or remove a bound field later on, I need to change the That's correct.> reference number all over the place.. > Can I refer to the Field name directly somehow? Not directly. You can do something like this:http://forums.asp.net/p/1079673/1594202.aspx#1594202 Gotcha...that seems to be a pretty good solution.
Thanks again Peter Show quoteHide quote "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message news:OfcL2qz9JHA.5704@TK2MSFTNGP03.phx.gbl... > "Peter" <peter***@msn.com> wrote in message news:eqrq6Fz9JHA.1488@TK2MSFTNGP03.phx.gbl... > > *** [please don't top-post] *** > http://www.caliburn.nl/topposting.html > >>>>>> I have a <asp:Boundfield> which returns the value of a datasource field. Can I have the text display something else depending >>>>>> on the value of the field? >>>>> >>>>> http://forums.asp.net/p/1190117/2058828.aspx#2058828 >>>>> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx >>>> >>>> Thanks Mark but what's the substitute for RowDataBound in DetailsView >>> >>> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.itemcreated.aspx >> >> in a GridView, I need to use Cells[0], Cells[1], Cells[3], etc.... to refer to the cell contents in displayed order. .. > > That's correct. > > >> What if I add or remove a bound field later on, I need to change the reference number all over the place.. > > That's correct. > > >> Can I refer to the Field name directly somehow? > > Not directly. You can do something like this: > http://forums.asp.net/p/1079673/1594202.aspx#1594202 > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net "Peter" <peter***@msn.com> wrote in message
http://www.caliburn.nl/topposting.html
news:ODOkYM09JHA.4560@TK2MSFTNGP03.phx.gbl... > Gotcha...that seems to be a pretty good solution. "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message news:O9arVk09JHA.4204@TK2MSFTNGP04.phx.gbl... Sorry...got use to the replying emails habbit.. :)> "Peter" <peter***@msn.com> wrote in message news:ODOkYM09JHA.4560@TK2MSFTNGP03.phx.gbl... > >> Gotcha...that seems to be a pretty good solution. > > http://www.caliburn.nl/topposting.html > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net
Other interesting topics
Problem with AddHandler (New CommandEventHandler) under framework 2.0
Disable Validation For Dynamically Created Control Multiple Drop-Downs <forms loginUrl="https:// pb C# / VB.NET code which takes a datetime in as parameter and returns a string too many forms, what should I do? How to write metainformation in asp.net dll How to get an https url when using Forms and Default login redirect Can't get started with this JavaScript Permissions on new Text File - IIS6 and Windows authentication. |
|||||||||||||||||||||||