BoundFiled/GridView
-
Have some questions: Until now edit it so that when you click on the edittemplate appears. See Picture Is it possible to change it in such a way that the EditItemTemplate appears when you click on the BoundField ?
-
Have some questions: Until now edit it so that when you click on the edittemplate appears. See Picture Is it possible to change it in such a way that the EditItemTemplate appears when you click on the BoundField ?
Hi! i've seen that you've solved your row sorting problem! nice! ;) but now your problem is? you have to read the RowUpdating event and also use the RowCommand event! if you click the 'edit' command, c# runs in RowUpdating event and then fires RowCommand (using e.CommandName as "Edit"). using this you can hide or make visible the columns. ex.
foreach (GridViewRow r in GV_ServiciosDetalles.Rows)
{
((Panel)r.FindControl("Panel1")).Style.Remove("display");//Make column visible true
((Panel)r.FindControl("Panel2")).Style["display"] = "none";//Make column visible false
}So in panel 1 you have a label with Text='<%#Eval("YourBoundField")%>' and in panel 2 you have a textbox with same thing. good luck
-
Hi! i've seen that you've solved your row sorting problem! nice! ;) but now your problem is? you have to read the RowUpdating event and also use the RowCommand event! if you click the 'edit' command, c# runs in RowUpdating event and then fires RowCommand (using e.CommandName as "Edit"). using this you can hide or make visible the columns. ex.
foreach (GridViewRow r in GV_ServiciosDetalles.Rows)
{
((Panel)r.FindControl("Panel1")).Style.Remove("display");//Make column visible true
((Panel)r.FindControl("Panel2")).Style["display"] = "none";//Make column visible false
}So in panel 1 you have a label with Text='<%#Eval("YourBoundField")%>' and in panel 2 you have a textbox with same thing. good luck
-
Im usin a GridView, Edit, Update, Delete and Cancel are already exist. Below the Header: SkillGroup is the BoundField and i try to click of the Boundfield. i aint have no labels. Just boundfield visible ="true"
Using a css class
.hiddencol /\*Make invisible the column\*/ { display:none; } .visiblecol /\*Make visible the column\*/ { display:block; }
To hide / show the columns
<asp:ButtonField ButtonType="Link" CommandName="Save" ItemStyle-CssClass="hiddencol" />
<ItemTemplate><ItemStyle CssClass="hiddencol" />
</ItemTemplate><ItemTemplate>
<ItemStyle CssClass="visiblecol" /&;gt;
</ItemTemplate>;
</ItemTemplate>then in your RowCommand you can change the 'visiblecol' style by 'hiddencol' and 'hiddencol' by 'visiblecol' like I've posted before