0

I am working with a Telerik Radgrid on an aspx page, which basically has to bind to a datatable, which gets populated by data returned from a web service. I need to be able to fill out some of the columns in the RADGRID based on the data returned by the web service. For example, I need to be able to build the Hyperlink column based on the parts data returned by the web service. I need a way to access the datasource before the grid item gets populated and direct execution to a routine which builds the URL for the parts on a website.

Can anybody please suggest an efficient way to do this? I highly appreciate any help/suggestions.

Thanks Karthik

karry
  • 3,270
  • 3
  • 18
  • 31
  • As in you have data that is in (lets say) column one and the hyperlink column should use data from column one to populate the link? Like this --> http://i.imgur.com/xSmfm.png – KreepN Oct 27 '11 at 18:33
  • The data I need is not even technically bound to the grid...it is one of the attributes returned by the web service, which i do not show in the grid.The web service returns a list of "Part" objects per row, which I will need to use to build the hyperlink URL. – karry Oct 27 '11 at 18:40
  • 1
    You could always cheat and bind it to the grid, allowing you to access the data, but then hide the columns so the users could never get the data. Would that work? – KreepN Oct 27 '11 at 18:44
  • that seems like a good approach...let me try that out ...will update this thread with the results ..Thanks for your help... – karry Oct 27 '11 at 18:49

1 Answers1

2

(Moving my comment to an answer, because I'm thinking this will work out for you.)

You could always cheat and bind it to the grid, allowing you to access the data, but then hide the columns so the users could never get the data.

Let me know how it works out.

EDIT:

My select statement is "select top 5 ProductName from products"

I then created a hyperlink column and assigned the properties under the data tab as such.

When run, it makes the data clickable and when clicked, it navigates to the url seen in the SS.

That what you need?

enter image description here

KreepN
  • 8,528
  • 1
  • 40
  • 58
  • One more question though... I need to assign a datatable as the datasource for the RADGrid. the datatable has datatypes like string, int, bool etc whereas the radgrid columns are of different types (Hyperlink,image etc) i just need to use the string values in the datatable to build the hyperlink column. can you suggest which event I can use to do this? When i assign a datatable as a datasource to a grid, it assumes the grid column datatypes to be same as the source datatypes...right?? – karry Oct 28 '11 at 20:48
  • 1
    If you choose to auto generate the columns, then yes the columns become the type of the data table. If you manually create the columns you can select any type of column and assign it a datafield. There are a variety of events you can use to do this, but they all use different syntax. Give me a sec to find the best way to do this. – KreepN Oct 28 '11 at 21:30
  • Edited at bottom, get back to me if you need more help. – KreepN Oct 28 '11 at 21:44
  • Thanks for all the help KreepN ... Appreciate it – karry Nov 02 '11 at 20:14
  • No problem. Feel free to hit me up via one of my answers in case you ever need any more help or have posted any more questions. I work with Telerik's tools daily and am always willing to help out. – KreepN Nov 02 '11 at 20:26