if (e.Row.RowType == DataControlRowType.DataRow && gridCategory.EditIndex ==e.Row.RowIndex) { string MenuName = ((HiddenField)e.Row.FindControl("hiddenMenuName")).Value; DropDownList ddlMenu = (DropDownList)e.Row.FindControl("ddlMenu"); bindddMenu(ddlMenu, MenuName); } else if (e.Row.RowType == DataControlRowType.Footer) { DropDownList ddlMenu = (DropDownList)e.Row.FindControl("ddlMenu"); bindddMenu(ddlMenu, ""); } else if (e.Row.RowType == DataControlRowType.EmptyDataRow) { DropDownList ddlMenu = (DropDownList)e.Row.Controls[0].Controls[0].FindControl("ddlMenu"); bindddMenu(ddlMenu, ""); } OR protected void gridCategory_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.EmptyDataRow) { DropDownList ddlMenu = (DropDownList)e.Row.FindControl("ddlMenu"); bindddMenu(ddlMenu, ""); } }
Sunday, August 11, 2013
Bind DropDownList in Edit Footer And Empty templates
Thursday, August 8, 2013
CSS For Grid
<style type="text/css"> .grid { border:1px solid #111111; margin: 5px 0 10px 0; width:95%; font-size:1.2em; } .grid a:link { color:#114477; } .grid tr th { background-color:#336699; color:#FFFFFF; height:25px; font-weight:bold; } .grid tr, .grid th, .grid td { padding:5px; } .grid tr { background-color:#FFFFFF; color:#222222; } .grid tr.alt { background-color:#EDEDED; color:#222222; } .grid .pgr td { background-color:#bdbdbd; font-weight: bold; color:#555555; padding:1px; } .grid .pgr td a { padding:1px; } .grid .pgr td span { padding:1px; } </style>
Subscribe to:
Posts (Atom)