Image Button in Datagrid
-
Hi, I already added an image button in Edit Item Template. I created calendar in Edit Item Template, i make it invisible. How to show calendar whenever image button clicked in datagrid???? Thanks, usha
A possibility: Investigate using AJAX and embed an
UpdatePanel
in theEditItemTemplate
containing the calendar with it's visible property set tofalse
. When the image click event is fired, set the calendar's visible property totrue
to show the calendar. Good luck.../F - .NET Developer
-
A possibility: Investigate using AJAX and embed an
UpdatePanel
in theEditItemTemplate
containing the calendar with it's visible property set tofalse
. When the image click event is fired, set the calendar's visible property totrue
to show the calendar. Good luck.../F - .NET Developer
-
Hi, Thanks for ur reply... Calendar drpDgTrType = (Calendar )Datagrid1.FindControl("drpDgTrType"); drpDgTrType.visible = true; However, i got Object reference not set to an instance of an object error when i run the codes. Please help... regards, usha
On Row Create set the Command Arg to the row index. On the Command event of the gridview, set the command name of the Image button to ImgClicked or any thing you like. In the Method of the Command event.
if (e.CommandName == "ImgClicked")
{
((Calendar)GridView.Rows[e.CommandArgs].FindControl("drpDgTrType")).visible = true;
}Well more or less. Hope it helps.
-
Hi, I already added an image button in Edit Item Template. I created calendar in Edit Item Template, i make it invisible. How to show calendar whenever image button clicked in datagrid???? Thanks, usha