|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
Is there any way to launch c# code when a button is pressed on a particular row of a grid?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi, You can use ButtonColumn and set the Grid's RunningMode to Server if you wish to always raises server event when the button is clicked: http://demo.essentialobjects.com/Demos/Grid/Features/Button%20Column/Demo.aspxIf you only want to raise server event when certain items are clicked, you can run the Grid in Client mode and then use JavaScript to handle the button click (through the Grid's ClientSideOnItemCommand property). Inside your event handler you can call this JavaScript method to raises the server event: https://www.essentialobjects.com/doc/jsdoc.public.web.grid.raiseitemcommandevent.aspxThanks
|
|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
My grid does not behave like this. With EnableKeyboardNavigation set to true, the arrow keys do not move the cursor or focus to an adjacent cell. The tab key also does not move it.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
What version do you use?
|
|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
v2.0.50727
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
That's your .NET framework version. You need to find out what version of EO.Web you are using.
|
|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
17.0.81.0
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
In that case you can compare the sample source code with your code and see if you can find what triggered the difference. The sample source code is inside the Samples directory. Usually as soon as you find out what triggered the problem, it will make sense to you.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
I don't see much difference between what I am trying to do and the sample. The differences are I am using alternating row styles and I have some client events that are triggered when editing, but even if I remove those events, I am not able to navigate with the keyboard. I'm stuck...
|
|
Rank: Member Groups: Member
Joined: 3/7/2017 Posts: 20
|
Nevermind, I got it. I needed to add the following to my ItemStyles section: <SelectedStyle CssText="background-color:#316ac5;color:white;"></SelectedStyle>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Great. Glad to hear that you found out. Please feel free to let us know if you run into any other issues.
|
|