This is a migrated thread and some comments may be shown as answers.

Open a new window when clicking on a column in the RadGrid

2 Answers 339 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 15 Apr 2016, 07:11 PM

I have a RadGrid on an ASP.Net page with VB.net as the code-behind.

The columns are not auto-generated.  Some columns are hidden when the RadGrid is first loaded by setting the Display property to false.  This is the Summary View.  I have a RadioButtonList to allow the user to choose between Summary View and Detail View.  When the user selects Detail View, the columns that were hidden have their Display property set to True and then can see the hidden columns and their data.  This is done in the PreRender event procedure for the RadGrid.

I need to add a new column that has a link, image button, push button, or something that when clicked on will open a new window using radopen in a javascript function with a different ASP.Net page that has some of values from the row that was clicked on.

Also I am using the RadTabStrip so the user can see the windows that were opened.

I have looked at several threads in this forum regarding people trying to do the same thing or something similar and have tried the sample code that someone from Telerik provided or sample code other people posted.  Nothing worked.  I have tried a GridButtonColumn and a GridTemplateColumn.  

For now, I have set up a simple Javascript function that calls the alert function for testing.  The javascript function was put in a separate javascript file called scripts.js which is loaded by the ASP.Net page with RadGrid by using the following line of code: <script src="/Scripts/scripts.js" type="text/javascript"></script> .

The closest I was able to get something to work just showed the alert window pop up but was not able to access the data from the row that was clicked on.

One of the things I have tried caused an error to occur when selecting Detail View.

Please help.  Thanks!

Sincerely,

Keith Jackson

2 Answers, 1 is accepted

Sort by
0
Keith
Top achievements
Rank 1
answered on 18 Apr 2016, 03:03 PM

I was able to figure out how to get it to work using the Window Editing demo for the RadGrid.  I have found I had multiple mistakes the first time I tried using the Window Editing demo in my scenario but also found that it was not clear what DataKeyNames and ClientDataKeyNames was referencing for the Name.  At first I had thought it was the UniqueName for the column.  Even the Telerik documentation was not clear on what name to use.  UniqueName for the column was not it.  It is actually the name used in the DataField property of the column which is the name of the field in the table.

It is working now. The column that I got it working on is not databound.

Now I need to add another column to do the same thing but it will be databound.  Both columns will open a new window but each will open a new window for a different ASP.Net page.  How to set it up so it knows which column was clicked on so it knows which ASP.Net page to load in the new window?

 

Sincerely,

Keith Jackson

0
Keith
Top achievements
Rank 1
answered on 21 Apr 2016, 02:40 PM

I was not able to create a working GridButtonColumn that was data-bound and is a LinkButton that was successfully able to open a radwindow.  Every time I clicked on it, I would briefly see the window and then it would only show minimized on the RadTabStrip.  Clicking on it did not show the window.

So I set up another column like what I did before to open a radwindow from the RadGrid to allow the user to modify the data in one of the data-bound columns.

I am disappointed that no one from Telerik or anyone else bothered to reply to this post.

Tags
Grid
Asked by
Keith
Top achievements
Rank 1
Answers by
Keith
Top achievements
Rank 1
Share this question
or