i am having a gridView. i need to throw a popup when User clicks a link button inside the gridview in the 2nd column. The 6th column of a gridview is having comma - seperated Ids. All i need to do is genrate a popup when user clicks the link button having
a listview or gridview. and then show these comma seperated Ids over it .... HELP!
i have managed to get the Ids(comma seperated)..from the 6th column. but my problem starts when i need to populate these values (split by ,) to a gridview.. i want to do and my need is to do all this work through Jquery....
i would like to add the further thing is the 6th column i mentioned is set to visible = "FALSE"
First of all, putting CSVs in a seperate column and hiding this column will not work. Instead of this, place a HiddenField control in any column wich is going to be visible and put these CSVs in this HiddenField control.
Now, on clicking a button, call a JavaScript fnuction to populate these CSVs in the popup.
To split the CSVs, use: var array
= myString.split(',');
To populate these CSVs in the popup, you have to do a work arround of creating a HTML Table dynamically and showing it in popup.
my Gridview is inside a Web user Control. In the User control , i am having a gridview.
The control is Placed inside an aspx page. How to write the JQUery to exactly refer the gridview inside the Web user control....
if the gridview Would not inside the Web User Control I could Easliy write..
HassamUddin
Member
17 Points
9 Posts
Populate the Comma-seperated Ids to gridview using JQUERY
Mar 13, 2012 06:45 AM|LINK
i am having a gridView. i need to throw a popup when User clicks a link button inside the gridview in the 2nd column. The 6th column of a gridview is having comma - seperated Ids. All i need to do is genrate a popup when user clicks the link button having a listview or gridview. and then show these comma seperated Ids over it .... HELP!
i have managed to get the Ids(comma seperated)..from the 6th column. but my problem starts when i need to populate these values (split by ,) to a gridview.. i want to do and my need is to do all this work through Jquery....
i would like to add the further thing is the 6th column i mentioned is set to visible = "FALSE"
Sum8
Contributor
4141 Points
931 Posts
Re: Populate the Comma-seperated Ids to gridview using JQUERY
Mar 13, 2012 07:15 AM|LINK
First of all, putting CSVs in a seperate column and hiding this column will not work. Instead of this, place a HiddenField control in any column wich is going to be visible and put these CSVs in this HiddenField control.
Now, on clicking a button, call a JavaScript fnuction to populate these CSVs in the popup.
To split the CSVs, use: var array = myString.split(',');
To populate these CSVs in the popup, you have to do a work arround of creating a HTML Table dynamically and showing it in popup.
Refer this link for creating and populating the HTML table dynamically using jQuery: http://stackoverflow.com/questions/103489/building-an-html-table-on-the-fly-using-jquery
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"
HassamUddin
Member
17 Points
9 Posts
Re: Populate the Comma-seperated Ids to gridview using JQUERY
Mar 13, 2012 10:49 AM|LINK
Thank u show much.. :)
now i have one more Problem.
my Gridview is inside a Web user Control. In the User control , i am having a gridview.
The control is Placed inside an aspx page. How to write the JQUery to exactly refer the gridview inside the Web user control....
if the gridview Would not inside the Web User Control I could Easliy write..
$(document).ready(function () {
$("#<%=gdvwJobForMergeAndPalletize.ClientID%> tr").not(':first').hover(function () {
$(this).css("background-color", "#cccccc");
}, function () {
$(this).css("background-color", "#ffffff");
});
But How to Refer the Grid view in side the Web Control using the Jquery in ASPX parent Page.
Sum8
Contributor
4141 Points
931 Posts
Re: Populate the Comma-seperated Ids to gridview using JQUERY
Mar 13, 2012 11:20 AM|LINK
Look into the ViewSource of the webpage and find the rendered client id of the GridView in the User Control.
Use this rendered client id of the GridView in your jQuery function.
Here, instead of <%=gdvwJobForMergeAndPalletize.ClientID%> use the static rendered client id.
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"
HassamUddin
Member
17 Points
9 Posts
Re: Populate the Comma-seperated Ids to gridview using JQUERY
Mar 13, 2012 01:41 PM|LINK
i am not getting this done.. i dont knw why.. may be i am putting a wrong syntax
$("ctl00_masterContentPlaceHolder_MergeJobPanel_gdvwJobForMergeAndPalletize tr").not(':first').hover(function () {
$(this).css("background-color", "#cccccc");
}, function () {
$(this).css("background-color", "#ffffff");
});
but nothing is happening on row hover ..:(
this is the html rendered Control Id = "ctl00_masterContentPlaceHolder_MergeJobPanel_gdvwJobForMergeAndPalletize"
Sum8
Contributor
4141 Points
931 Posts
Re: Populate the Comma-seperated Ids to gridview using JQUERY
Mar 14, 2012 05:06 AM|LINK
Replace it with
$('#ctl00_masterContentPlaceHolder_MergeJobPanel_gdvwJobForMergeAndPalletize tr').not(':first').hover(function () {
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"