Can I bind more than 1 field in a HyperlinkColumn?
-
In the datagrid.aspx, there is a Edit Hyperlink. When you click on the current page, it will go to customer.aspx. Whatever is in the datagrid - "data binded", will be bind on the (i.e, txtPCID.text, txtName.text, txtPrice.text, txtDescription.text). Is there anyway to do that? Can I bind more than 1 field in a HyperlinkColumn? If so, how?
-
In the datagrid.aspx, there is a Edit Hyperlink. When you click on the current page, it will go to customer.aspx. Whatever is in the datagrid - "data binded", will be bind on the (i.e, txtPCID.text, txtName.text, txtPrice.text, txtDescription.text). Is there anyway to do that? Can I bind more than 1 field in a HyperlinkColumn? If so, how?
Although I'm not exactly sure what you want, you could always use a template column and put whatever controls you want to appear in the column there.
-
Although I'm not exactly sure what you want, you could always use a template column and put whatever controls you want to appear in the column there.
Using a template column, as suggested, allows you to control your binding pretty precisely. So you can have as many asp controls inside a single column as you want, with appropriate databinding expressions for each. Keep in mind, that you can also have a databinding expression that calls a function in your code behind file. For example, you could have this function in your code: Public Function GetAutoAssignIndex(ByVal AutoAssign As Boolean) As Integer Dim index As Integer = 0 If AutoAssign = True Then index = 1 End If Return index End Function Your databind might look similar to this: This example is for a dropdown containing objects with an "AutoAssign" property defined.