Ask a Question related to ASP.NET General, Design and Development.
-
Trevor Hartman #1
datagrid if thens
hi,
I want to display certain data in my edititemtemplate in the datagrid based
on the value of a column. How do I do an if then inside the datagrid AND
test the value of the current column. i only know how to refer to columsn
with the <%# DataBinder.Eval(Container.DataItem, "column") %>, and i can't
include an if then in the <%# %> block. any suggestions?
thanks
-trevor
Trevor Hartman Guest
-
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event.
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the... -
UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of... -
custom usercontrol inside of datagrid - loses its state/viewstate on re-bind/postback of the datagrid
I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of... -
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to... -
easy and quick Question - relating to If, thens
im relatively new to scripting in director and i am trying to write a script with multiple conditions on it. this is part of the second handler on... -
Steve C. Orr, MCSD #2
Re: datagrid if thens
Seems your code would be best in the OnItemCreated event or the
OnItemDataBound event.
If e.Item.Cells(1).Value = 1 Then ...
Here's more info:
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclassonitemcrea tedtopic.asp[/url]
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Trevor Hartman" <synapsee@hotmail.com> wrote in message
news:uUu04PvUDHA.2104@TK2MSFTNGP10.phx.gbl...based> hi,
> I want to display certain data in my edititemtemplate in the datagrid> on the value of a column. How do I do an if then inside the datagrid AND
> test the value of the current column. i only know how to refer to columsn
> with the <%# DataBinder.Eval(Container.DataItem, "column") %>, and i can't
> include an if then in the <%# %> block. any suggestions?
> thanks
> -trevor
>
>
Steve C. Orr, MCSD Guest
-
-
Severin #4
Re: datagrid if thens
Inside as datagrid control you can use the 'IIf([expression], True, False)'
function...
Any function calls in either the 'TruePart or Falsepart' will be called
regardless of the value of [expression]
I use this to toggle the 'visible' attribute in <asp:image /> controls in a
datagrid or datalist like so....
<asp:image id="imgLogo" imageUrl='<%# Container.DataItem("picpath") %>'
visible='<%# IIf(Container.DataItem("picpath") Is DbNull.Value, "False",
"True") %>' />
This IIf() function toggles the image visible to 'False' if "picpath" is
DbNull.Value, else it displays if there is a value in "picpath"
Severin
"Trevor Hartman" <synapsee@hotmail.com> wrote in message
news:uUu04PvUDHA.2104@TK2MSFTNGP10.phx.gbl...based> hi,
> I want to display certain data in my edititemtemplate in the datagrid> on the value of a column. How do I do an if then inside the datagrid AND
> test the value of the current column. i only know how to refer to columsn
> with the <%# DataBinder.Eval(Container.DataItem, "column") %>, and i can't
> include an if then in the <%# %> block. any suggestions?
> thanks
> -trevor
>
>
Severin Guest
-
Saravana #5
Re: broken link?
It is
[url]www.microsoft.com/india/msdn/articles/SolutionstoTopFourQuestions.aspx[/url]
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Trevor Hartman" <synapsee@hotmail.com> wrote in message
news:#xhZWJPVDHA.3924@tk2msftngp13.phx.gbl...[url]http://www.microsoft.com/india/msdn/articles/SolutionstoTopFourQuestions.asp[/url]>
> "Saravana" <saravank@sct.co.in> wrote in message
> news:O2MQx20UDHA.2364@TK2MSFTNGP09.phx.gbl...>> > Check out this article,
> >> AND> > x
> >
> > --
> > Saravana
> > Microsoft India Community Star,
> > MCAD,SE,SD,DBA.
> >
> >
> > "Trevor Hartman" <synapsee@hotmail.com> wrote in message
> > news:uUu04PvUDHA.2104@TK2MSFTNGP10.phx.gbl...> > based> > > hi,
> > > I want to display certain data in my edititemtemplate in the datagrid> > > on the value of a column. How do I do an if then inside the datagrid> columsn> > > test the value of the current column. i only know how to refer to> can't> > > with the <%# DataBinder.Eval(Container.DataItem, "column") %>, and i>> >> > > include an if then in the <%# %> block. any suggestions?
> > > thanks
> > > -trevor
> > >
> > >
> >
>
Saravana Guest



Reply With Quote

