I have a quistion in datagrid :
When i bind the data to DataGrid how i can make the item in every cell at datagrid go to diffrent aspx page when user click on the item in the cell.. i need the exactly code for that...
Regard
Printable View
I have a quistion in datagrid :
When i bind the data to DataGrid how i can make the item in every cell at datagrid go to diffrent aspx page when user click on the item in the cell.. i need the exactly code for that...
Regard
Hello ,
No body can help me?!!!!!!!!!!!!!!!
try to use hiperlink.Quote:
Originally Posted by alqous
See Datagrid properties
I don't have code for you, but I'll give you instructions.
Set up a templatecolumn in your datagrid with a hyperlink in it.
In the itemdatabound event of the datagrid, loop through each row, do a findcontrol for the hyperlink, and according to the corresponding row in your dataset, set it's navigateurl property.
all your columns will have to be Hyperlinks. You have to go to your HTML view and in the datagrid section add this code per column
<asp:HyperLinkColumn Text="A" Target="_blank" DataNavigateUrlField="ID"
DataNavigateUrlFormatString="yourpage.aspx?MID={0}" HeaderText="View">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle
HorizontalAlign="Center"></ItemStyle>
</asp:HyperLinkColumn>
hope this helps
Jose