Shiva_Kumar
asked on
how to change the select button value to the row selected in Gridview
hi,
how do I change the select button value to the corresponding row/cell value in a Gridview
Thanks
how do I change the select button value to the corresponding row/cell value in a Gridview
Thanks
Could you please elaborate your question a little more?
please explain your question little more
You need to pass the cell value into the button's code parameter of value=''
Cheers.
Cheers.
ASKER
Hi bizjosh
Could you please explain me in detail how do i do this.
By default the button is a link and the default text it shows is "Select"
Thanks,
Shiva
Could you please explain me in detail how do i do this.
By default the button is a link and the default text it shows is "Select"
Thanks,
Shiva
The whole idea here is to first find the Select button, then you can change its Text property to whatever you wish.
ASKER
Ok... Let me explain what I am trying to here:
i have a gridview which populates on sigle column from the database like this.
abc
xyz
123
i wanted to have these values clickable so that i can populate another gridview next to it taking the SelectedIndexValue as one of the parameter to run another sql query to popluate the gridveiw2.
In order to achieve this i have added a commandfield select, so after adding this it shows something like this:
Select abc
Select xyz
Select 123
Now what i am to do is to have the "Select" to replace with the actual row values and the same time it should be clickable so that i can popluate the second gridview.
Please let me know if this is a wrong approach. If yes, the please let me know is there any alternate way of doing this.
Thanks,
Shiva
i have a gridview which populates on sigle column from the database like this.
abc
xyz
123
i wanted to have these values clickable so that i can populate another gridview next to it taking the SelectedIndexValue as one of the parameter to run another sql query to popluate the gridveiw2.
In order to achieve this i have added a commandfield select, so after adding this it shows something like this:
Select abc
Select xyz
Select 123
Now what i am to do is to have the "Select" to replace with the actual row values and the same time it should be clickable so that i can popluate the second gridview.
Please let me know if this is a wrong approach. If yes, the please let me know is there any alternate way of doing this.
Thanks,
Shiva
The better way to do is define DataKeyNames="YourPrimaryK eyField", then in the SelectedRowIndexChanged event handler, get the primary key as follows to run another query:
Dim id As Integer
id = Integer.Parse(Me.GridView1 .SelectedD ataKey.Val ue.ToStrin g())
Do you use VB or C#?
Dim id As Integer
id = Integer.Parse(Me.GridView1
Do you use VB or C#?
ASKER
I use VB
Can you try my comment then and let me know if it works for you?
ASKER
Nope, it didn't work for me.
any alternate suggestion?
any alternate suggestion?
What do you mean "it didn't work"? You got an error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
i was able to fix the second issue by adding the headertext = "false" in the girdview property.
Thanks
i was able to fix the second issue by adding the headertext = "false" in the girdview property.
Thanks