0
votes

I need to assign a datatable as the datasource for the telerik 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 data types...Am I right??

2

2 Answers

1
votes

Look at the DataNavigateUrlFields, DataNavigateUrlFormatString, DataTextField, and DataTextFormatString properties of <telerik:GridHyperLinkColumn />. You should be able to do something like:

<telerik:GridHyperLinkColumn
    DataNavigateUrlFields="categoryId,productId"
    DataNavigateUrlFormatString="productDetail.aspx?category={0}&product={1}"
    DataTextField="productName"
    DataTextFormatString="View {0} details" />
1
votes

You need to use a GridBoundColumn or GridTemplateColumn. There is a DataType property, but you shouldn't need it.

<telerik:GridBoundColumn HeaderText="Foo" DataField="Foo" DataType="System.String" ...>