Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello all,
i have listview with some data

it has one label which is returning either true, false or pending

what i want is, if it returns true
it should enable radbutton1 which is inside listview

if it returns false
it should enable radbutton2 which is inside listview

if it returns pending
it should make those two radio buttons visiblity false.

and status will be different for diffrent rows in my listview, so my radio buttons which are repeating its visiblity will also be different for different rows.
can anyone explain...how to do it?

My Code
ASP.NET
<asp:ListView ID="ListView2" runat="server" OnPagePropertiesChanging="ListView1_PagePropertiesChanging" 
    onitemcommand="ListView1_ItemCommand">
    <alternatingitemtemplate>
        <p align="justify">
            <span style="color: #000000; text-align: center; width: 100%;">
                <asp:Label ID="DescriptionLabel2" runat="server" Text='<%# Eval("Message") %>' />
            </span>
            <asp:RadioButton ID="radYes" runat="server" Text="Yes" GroupName="Action" />
            <asp:RadioButton ID="radNo" runat="server" Text="No" GroupName="Action" />
        </p>
    </alternatingitemtemplate>
    <edititemtemplate>
        <p align="justify">
            <span style="color: #000000; text-align: center; width: 100%;">
               <asp:Label ID="DescriptionLabel2" runat="server" Text='<%# Eval("Message") %>' />
            </span>
            <asp:RadioButton ID="radYes" runat="server" Text="Yes" GroupName="Action" />
            <asp:RadioButton ID="radNo" runat="server" Text="No" GroupName="Action" />
        </p>
    </edititemtemplate>
    <emptydatatemplate>
        <span style="color: #FF0000; font-weight: bold;">Sorry! No Records found...</span>
    </emptydatatemplate>
    <insertitemtemplate>
        <p align="justify">
            <span style="color: #000000; text-align: center; width: 100%;">
               <asp:Label ID="DescriptionLabel2" runat="server" Text='<%# Eval("Message") %>' />
            </span>
            <asp:RadioButton ID="radYes" runat="server" Text="Yes" GroupName="Action" />
            <asp:RadioButton ID="radNo" runat="server" Text="No" GroupName="Action" />
        </p>
    </insertitemtemplate>
    <itemtemplate>
        <p align="justify">
            <span style="color: #000000; text-align: center; width: 100%;">
                <asp:Label ID="DescriptionLabel2" runat="server" Text='<%# Eval("Message") %>' />
            </span>
            <asp:RadioButton ID="radYes" runat="server" Text="Yes" GroupName="Action" />
            <asp:RadioButton ID="radNo" runat="server" Text="No" GroupName="Action" />
        </p>
    </itemtemplate>
    <SelectedItemTemplate>
        <p align="justify">
            <span style="color: #000000; text-align: center; width: 100%;">
                <asp:Label ID="DescriptionLabel2" runat="server" Text='<%# Eval("Message") %>' />
            </span>
            <asp:RadioButton ID="radYes" runat="server" Text="Yes" GroupName="Action" />
            <asp:RadioButton ID="radNo" runat="server" Text="No" GroupName="Action" />
        </p>
    </SelectedItemTemplate>
    <itemseparatortemplate>
        <hr />
    </itemseparatortemplate>
</asp:ListView>
Posted
Updated 16-Mar-13 3:46am
v2
Comments
sunil mali 16-Mar-13 9:25am    
I hope my question is clear
sunil mali 17-Mar-13 2:46am    
thanks prasad for editing my comment as i was not able to format it....Waiting for someone;s reply.

1 solution

 
Share this answer
 
Comments
sunil mali 19-Mar-13 3:58am    
Thank you so much Nitin.....
Perfect solution...I tried and it worked...
now i can give full stop to my task...
very good link thanks once again...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900