[RESOLVED]Populate the Comma-seperated Ids to gridview using JQUERY

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.

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

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.

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.

HassamUddin

$("#<%=gdvwJobForMergeAndPalletize.ClientID%> tr").not(‘:first’).hover(function () {

Here, instead of <%=gdvwJobForMergeAndPalletize.ClientID%> use the static rendered client id.

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"

HassamUddin

$("ctl00_masterContentPlaceHolder_MergeJobPanel_gdvwJobForMergeAndPalletize tr").not(‘:first’).hover(function () {

Replace it with

$(‘#ctl00_masterContentPlaceHolder_MergeJobPanel_gdvwJobForMergeAndPalletize tr’).not(‘:first’).hover(function () {

 

Leave a Reply