This is a migrated thread and some comments may be shown as answers.

Dynamic Grid with Client Side Events

3 Answers 45 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Paul Gallen
Top achievements
Rank 1
Paul Gallen asked on 10 Sep 2008, 07:33 AM

Hi

I have built a dynamic grid on the Page Init

Now I need to hook up the client side events (OnRowDblClick etc…) for this type of grid. Is this possible??

P

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Sep 2008, 08:45 AM
Hello Paul,

You can set grid.ClientSettings.ClientEvents.OnRowDblClick to desired JavaScript function.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul Gallen
Top achievements
Rank 1
answered on 10 Sep 2008, 12:00 PM
Thanks Vlad,

These client events do not get fired, below is my dynamic grid, maybe you can spot something obvious

 


Dim grdBaseListMembers As New RadGrid

grdBaseListMembers.ID =

"grdBaseListMembers"

 

grdBaseListMembers.Skin =

"Office2007"

grdBaseListMembers.Width = Unit.Percentage(100)

grdBaseListMembers.Height = Unit.Percentage(100)

' grdBaseListMembers.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric

grdBaseListMembers.AutoGenerateColumns =

False

grdBaseListMembers.AllowMultiRowSelection =

True

grdBaseListMembers.Height = Unit.Percentage(100)

grdBaseListMembers.MasterTableView.Width = Unit.Percentage(100)

grdBaseListMembers.ClientSettings.Scrolling.AllowScroll =

True

grdBaseListMembers.MasterTableView.DataKeyNames =

New String() {"BaseListID", "BaseContactID", "BaseListMemberID"}

grdBaseListMembers.MasterTableView.EditMode = GridEditMode.InPlace

' grdBaseListMembers.MasterTableView.PageSize = 10

' grdBaseListMembers.MasterTableView.AllowPaging = True

grdBaseListMembers.MasterTableView.Width = Unit.Percentage(100)

grdBaseListMembers.ClientSettings.Selecting.AllowRowSelect =

True

grdBaseListMembers.ClientSettings.ClientEvents.OnRowDblClick =

"RowDblClick1"

grdBaseListMembers.ClientSettings.ClientEvents.OnRowSelected =

"RowSelected"

Thanks P

0
Sebastian
Telerik team
answered on 15 Sep 2008, 10:37 AM
Hi Paul,

It seems that you attached the client event for the grid properly -  I assume that you have the corresponding javascript handlers registered on the page. Do you receive any javascript errors when selecting/double-clicking grid items? Additionally, can you verify that you added the grid to a placeholder on the page as shown in this article from the documentation?

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Paul Gallen
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Paul Gallen
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or