Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2008, 07:53 PM
Registered User
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default plz plz plz......help me

Hi guys i have a problem with DataGrid in .Net1.1
can anybody help me plz.....very urgent....

I have a datagrid containing 2 columns. In one column the values are displayed by binding datafield.the other column is template column which contains dropdownlist.

I need to enable dropdownlist only if the value in column1 matches some condition. I hard coded the values in DDl

Column1 Column2
red Enable DDL
red Enable DDL
blue Disable DDL
white Disable DDL
red Enable DDL
blue Disable DDL

i have written the following code:

<asp:BoundColumn DataField="Column1" HeaderText="Column1">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Column2">
<ItemStyle HorizontalAlign="Center"VerticalAlign="Middle"></ItemStyle>
<ItemTemplate>
<P>
<asp:DropDownList id="Column2DDL" Runat="server" Enabled='<%# GetDDLSetting(DataBinder.Eval(Container, "DataItem.Column1")) %>'>
<asp:ListItem Value="--Select--">--Select--</asp:ListItem>
<asp:ListItem Value="Good">1st degree</asp:ListItem>
<asp:ListItem Value="Average">5 degree</asp:ListItem>
<asp:ListItem Value="Poor">10 degree</asp:ListItem>
</asp:DropDownList></P>
</ItemTemplate>
</asp:TemplateColumn>


in the code behind i had a function

protected bool GetDDLSetting(object myobj)
        {
            if(myobj.ToString()=="red")
            {
                return true;
            }
            else
            {
                return false;
            }
        }

the function is getting compiled but my DDL is not getting enabled if the value in column1 is equal to red.

please help me.......very urgent need.....i have a dead line.......plz guys.....

Very Thanks in advance!!!!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM
plz tell me flowertear Pro Visual Basic 2005 2 November 28th, 2006 08:30 PM
Plz help me ritesh_ch23 Pro JSP 1 July 18th, 2006 10:46 PM
Plz plz someone help beetle_jaipur CSS Cascading Style Sheets 3 March 26th, 2006 05:37 AM
Help me plz waqaraziz VB.NET 2002/2003 Basics 1 March 19th, 2005 04:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.