Welcome Guest Search | Active Topics | Sign In | Register

grid button Options
Kevin
Posted: Thursday, May 18, 2017 3:52:27 PM
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?
eo_support
Posted: Friday, May 19, 2017 8:52:45 AM
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.aspx

If 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.aspx

Thanks
Kevin
Posted: Tuesday, May 30, 2017 11:49:17 AM
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.
eo_support
Posted: Tuesday, May 30, 2017 11:55:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
What version do you use?
Kevin
Posted: Tuesday, May 30, 2017 11:58:05 AM
Rank: Member
Groups: Member

Joined: 3/7/2017
Posts: 20
v2.0.50727
eo_support
Posted: Tuesday, May 30, 2017 12:00:34 PM
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.
Kevin
Posted: Tuesday, May 30, 2017 1:07:54 PM
Rank: Member
Groups: Member

Joined: 3/7/2017
Posts: 20
17.0.81.0
eo_support
Posted: Tuesday, May 30, 2017 8:23:19 PM
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!
Kevin
Posted: Thursday, June 8, 2017 2:28:19 PM
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...
Kevin
Posted: Thursday, June 8, 2017 2:37:49 PM
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>
eo_support
Posted: Thursday, June 8, 2017 5:16:34 PM
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.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.