hello,Everyone
In my Project I have requirement of generic grid view .where I cant use In built server side Controls.
I have made grid view and all its template text box and bound field with help of c# and there
Is requirement ,On the selected index change of Drop down List the grid will generates the no
of columns which has template fields containing text box.if select 3 in specific rows drop down
then 3 columns comes at that row of grid view.
 
so ,please share your suggestion and ideas to help me out.
 
I will highly thank full of yours
  
 ----------------------------------------------------------------------------------------------------------------------------------
please check the attached folder below there will form two form 1.demo,2.ddlldynamic.
I want demo functionality of ddl in ddldynamic grid containing inside the grid  nt able to achive that functionallity.
 
 
--------------------------------------------------------------------
 
 
BorderStyle="None" BorderWidth="1px"
CellPadding="3" GridLines="Vertical" Height="34px" Width="100%"
Font-Names="Arial" Font-Size="Small" AutoGenerateColumns="False"
onrowcommand="GV_RowCommand">
AutoPostBack="True" onselectedindexchanged="ddlbudgetprd_SelectedIndexChanged"
>
Select Period
Monthly
Quaterly
Half-yearly
Annualy
RepeatDirection="Horizontal">
Yes
No
Font-Underline="True" />
 
 
 
 
 
 
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
int j = 0;
int k;
DropDownList ddlbudgetprd = (DropDownList)sender;
GridViewRow GVR = ((GridViewRow)ddlbudgetprd.Parent.Parent);
k = GVR.RowIndex;
if (GVR != null)
{
DropDownList lbName = GVR.FindControl("ddlbudgetprd") as DropDownList;
ddlbudgetprd = lbName;
}
j = Convert.ToInt32(ddlbudgetprd.SelectedValue);
//DropDownList dl = (DropDownList)GV.Rows[k].Cells[2].FindControl("ddlbudgetprd");
//j = Convert.ToInt32(dl.SelectedValue);
TextBox tx1 = (TextBox)GV.Rows[k].Cells[4].FindControl("Txtbudgetamt1");
TextBox tx2 = (TextBox)GV.Rows[k].Cells[5].FindControl("Txtbudgetamt2");
TextBox tx3 = (TextBox)GV.Rows[k].Cells[6].FindControl("Txtbudgetamt3");
TextBox tx4 = (TextBox)GV.Rows[k].Cells[7].FindControl("Txtbudgetamt4");
TextBox tx5 = (TextBox)GV.Rows[k].Cells[8].FindControl("Txtbudgetamt5");
TextBox tx6 = (TextBox)GV.Rows[k].Cells[9].FindControl("Txtbudgetamt6");
TextBox tx7 = (TextBox)GV.Rows[k].Cells[10].FindControl("Txtbudgetamt7");
TextBox tx8 = (TextBox)GV.Rows[k].Cells[11].FindControl("Txtbudgetamt8");
TextBox tx9 = (TextBox)GV.Rows[k].Cells[12].FindControl("Txtbudgetamt9");
TextBox tx10 = (TextBox)GV.Rows[k].Cells[13].FindControl("Txtbudgetamt10");
TextBox tx11 = (TextBox)GV.Rows[k].Cells[14].FindControl("Txtbudgetamt11");
TextBox tx12 = (TextBox)GV.Rows[k].Cells[15].FindControl("Txtbudgetamt12");
if (j == 1)
{
GV.Rows[k].Cells[4].Visible.Equals(true);
tx1.Visible = true;
GV.Rows[k].Cells[5].Visible.Equals(false);
tx2.Visible = false;
GV.Rows[k].Cells[6].Visible.Equals(false);
tx3.Visible = false;
GV.Rows[k].Cells[7].Visible.Equals(false);
tx4.Visible = false;
GV.Rows[k].Cells[8].Visible.Equals(false);
tx5.Visible = false;
GV.Rows[k].Cells[9].Visible.Equals(false);
tx6.Visible = false;
GV.Rows[k].Cells[10].Visible.Equals(false);
tx7.Visible = false;
GV.Rows[k].Cells[11].Visible.Equals(false);
tx8.Visible = false;
GV.Rows[k].Cells[12].Visible.Equals(false);
tx9.Visible = false;
GV.Rows[k].Cells[13].Visible.Equals(false);
tx10.Visible = false;
GV.Rows[k].Cells[14].Visible.Equals(false);
tx11.Visible = false;
GV.Rows[k].Cells[15].Visible.Equals(false);
tx12.Visible = false;
}
if (j ==2)
{
GV.Rows[k].Cells[4].Visible.Equals(true);
tx1.Visible = true;
GV.Rows[k].Cells[5].Visible.Equals(true);
tx2.Visible = true;
GV.Rows[k].Cells[6].Visible.Equals(true);
tx3.Visible = true;
GV.Rows[k].Cells[7].Visible.Equals(false);
tx4.Visible = false;
GV.Rows[k].Cells[8].Visible.Equals(false);
tx5.Visible = false;
GV.Rows[k].Cells[9].Visible.Equals(false);
tx6.Visible = false;
GV.Rows[k].Cells[10].Visible.Equals(false);
tx7.Visible = false;
GV.Rows[k].Cells[11].Visible.Equals(false);
tx8.Visible = false;
GV.Rows[k].Cells[12].Visible.Equals(false);
tx9.Visible = false;
GV.Rows[k].Cells[13].Visible.Equals(false);
tx10.Visible = false;
GV.Rows[k].Cells[14].Visible.Equals(false);
tx11.Visible = false;
GV.Rows[k].Cells[15].Visible.Equals(false);
tx12.Visible = false;
}
else if (j == 3)
{
GV.Rows[k].Cells[4].Visible.Equals(true);
tx1.Visible = true;
GV.Rows[k].Cells[5].Visible.Equals(true);
tx2.Visible = true;
GV.Rows[k].Cells[6].Visible.Equals(true);
tx3.Visible = true;
GV.Rows[k].Cells[7].Visible.Equals(true);
tx4.Visible = true;
GV.Rows[k].Cells[8].Visible.Equals(true);
tx5.Visible = true;
GV.Rows[k].Cells[9].Visible.Equals(true);
tx6.Visible = true;
GV.Rows[k].Cells[10].Visible.Equals(false);
tx7.Visible = false;
GV.Rows[k].Cells[11].Visible.Equals(false);
tx8.Visible = false;
GV.Rows[k].Cells[12].Visible.Equals(false);
tx9.Visible = false;
GV.Rows[k].Cells[13].Visible.Equals(false);
tx10.Visible = false;
GV.Rows[k].Cells[14].Visible.Equals(false);
tx11.Visible = false;
GV.Rows[k].Cells[15].Visible.Equals(false);
tx12.Visible = false;
}
else if (j == 4)
{
GV.Rows[k].Cells[4].Visible.Equals(true);
tx1.Visible = true;
GV.Rows[k].Cells[5].Visible.Equals(true);
tx2.Visible = true;
GV.Rows[k].Cells[6].Visible.Equals(true);
tx3.Visible = true;
GV.Rows[k].Cells[7].Visible.Equals(true);
tx4.Visible = true;
GV.Rows[k].Cells[8].Visible.Equals(true);
tx5.Visible = true;
GV.Rows[k].Cells[9].Visible.Equals(true);
tx6.Visible = true;
GV.Rows[k].Cells[10].Visible.Equals(true);
tx7.Visible = true;
GV.Rows[k].Cells[11].Visible.Equals(true);
tx8.Visible = true;
GV.Rows[k].Cells[12].Visible.Equals(true);
tx9.Visible = true;
GV.Rows[k].Cells[13].Visible.Equals(true);
tx10.Visible = true;
GV.Rows[k].Cells[14].Visible.Equals(true);
tx11.Visible = true;
GV.Rows[k].Cells[15].Visible.Equals(true);
tx12.Visible = true;
}