1

I want to add to my GridView from Devexpress ( c# asp.net ) a hyperlink column where i want to set the name of each row to the value of the data.

Is this possible? How?

user532104
  • 1,373
  • 6
  • 17
  • 27
  • What have you tried so far as I know for sure there is an example on the devexpress website, which makes me think you are just looking for someone to do everything for you. – ChrisBint Dec 06 '11 at 16:14
  • @user532104 take a look at here http://devexpress.com/Support/Center/p/E308.aspx – Glory Raj Dec 06 '11 at 16:14
  • What do you mean by "set the name of each row?" You mean the text displayed on the hyperlink? – Icarus Dec 06 '11 at 16:20

1 Answers1

6

From the ASPxGridView documentation regarding How to create and configure a HyperLink column at runtime:

public void PopulateColumns() {
    GridViewDataTextColumn colID = new GridViewDataTextColumn();
    colID.FieldName = "ID";
    ASPxGridView1.Columns.Add(colID);

    GridViewDataHyperLinkColumn colItemName = new GridViewDataHyperLinkColumn();
    colItemName.FieldName = "ItemName";
    colItemName.PropertiesHyperLinkEdit.NavigateUrlFormatString ="~/details.aspx?Device={0}";
    colItemName.PropertiesHyperLinkEdit.TextFormatString = "Device {0}";
    colItemName.PropertiesHyperLinkEdit.TextField = "ItemName";
    ASPxGridView1.Columns.Add(colItemName);
}
sshow
  • 8,820
  • 4
  • 51
  • 82