How to select a cell in datagrid onClick in ASP.net C#

后端 未结 2 454
栀梦
栀梦 2021-01-28 14:31

I am importing a column in datatable to my grid. Now I want navigate to a new page on selecting a cell in grid by fetching the selected value. I have tried this by including bou

2条回答
  •  旧时难觅i
    2021-01-28 14:53

    In your case you are binding boundfield with static a tag which have href attribute so your not able to change text on that boundfield from your database.To get your approach you should use TemplateField and bind data with text attribute using eval keyword as below example.

    Try it:

    
        
            
        
    
    

    OR

    you can also bind link with your hyperlink using NavigateUrl property of hyperlink as below example.

    
          
              
          
    
    

    I hope it will helpful to you.

提交回复
热议问题